Skip to content

Errors on unidentified key code. #83

@aemogie

Description

@aemogie

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions