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

Errors on unidentified key code. #83

Open
aemogie opened this issue Jul 17, 2022 · 0 comments
Open

Errors on unidentified key code. #83

aemogie opened this issue Jul 17, 2022 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@aemogie
Copy link
Contributor

aemogie commented Jul 17, 2022

Throws an ArrayIndexOutOfBoundsException when any key that GLFW does not support is pressed.
i.e. when keycode -1 is sent, it's still being used to index into the keystateBitfields array.

Steps to reproduce

  1. Open any scene
  2. On windows, hit a function key without the fn key, so that it does the action, such as increasing/decreasing volume/brightness.

What you expected would happen

For the key to be ignored.

What actually happens

An ArrayIndexOutOfBoundsException is thrown

Error logs

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 400
	at input.Keyboard.resetKeyDownBit(Keyboard.java:64)
	at input.Keyboard.lambda$setupCallbacks$0(Keyboard.java:41)
	at org.lwjgl.glfw.GLFWKeyCallbackI.callback(GLFWKeyCallbackI.java:44)
	at org.lwjgl.system.JNI.invokeV(Native Method)
	at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3397)
	at graphics.Window.showWindow(Window.java:205)
	at util.Engine.showWindow(Engine.java:55)
	at scenes.AudioDemo.main(AudioDemo.java:21)
@athaun athaun added bug Something isn't working good first issue Good for newcomers labels Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants