Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown with auxiliary keyboard keys and knobs #2407

Open
CalvinWilkinson opened this issue Dec 31, 2024 · 1 comment
Open

Exception thrown with auxiliary keyboard keys and knobs #2407

CalvinWilkinson opened this issue Dec 31, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@CalvinWilkinson
Copy link

Summary

When using auxiliary keys or knobs on a keyboard, the application crashes. At first, I thought it was something in my library Velaptor, but after some investigation, I discovered that an InvalidOperationException is being thrown from the Reset() method in the ViewImplementationBase abstract class in the Silk.NET.Windowing.Internals namespace.

I know this is because I looked into the internal exception being thrown in Velaptor, and the exception message is You cannot call 'Reset' inside of the render loop!. I found this by searching in the Silk source code for tag v2.22.0.

When I say 'auxiliary', I mean custom keyboard keys and knobs that are used for volume, mute, skipping songs, etc.
I have a mechanical keyboard and my laptop keyboard, which have some aux keys and/or knobs that cause the exception to be thrown.

Since Velaptor is open source, you can run the VelaptorTesting project. Once the window is displayed, adjust the audio knob on a keyboard that has one, and it should crash. I attempted to see if the problem would occur in the Imgui sample project, but I had issues with errors being thrown by nuke. I am confident you can reproduce the issue with the Silk example projects.

I subscribe to a keyboard key-down event of an IInputContext instance. I set a breakpoint in my event handler, but it is not invoked. It simply immediately throws an exception.

Steps to reproduce

  • Platform: Desktop
  • Framework Version: dotnet 9.0
  • API: OpenGL
  • API Version: OpenGL 4.5 Core
  1. Open the solution for the latest version tag of Velaptor or a Silk sample project.
  2. Run the VelaptorTesting project or a Silk sample project
  3. Adjust the volume knob or hit an aux key on a keyboard that has a this functionality.
  4. Observe that an exception is thrown.

Comments

The screenshots below are the knobs and keys that are causing the exception:
Image
Image

More Info:

  1. MONTECH Mechanical Keyboard
  2. [Asus ROG Zephyrus G16 Laptop](I know this is because I looked into the internal exception being thrown in Velaptor, and the exception message is You cannot call 'Reset' inside of the render loop!. I found this by searching in the Silk source code for tag v2.22.0.)

Note

This is not just a volume knob. It can be used for other functions on the keyboard, such as the lighting.
Hitting the volume up and down on my laptop keyboard causes the same issue.

If you need more information or testing, let me know, and I would be glad to help. Thanks!!

If you know how to fix this issue, please submit a pull request instead!

@Perksey
Copy link
Member

Perksey commented Dec 31, 2024

Do you have a stack trace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants