Raylib-J icon indicating copy to clipboard operation
Raylib-J copied to clipboard

Pressing certain "Special Function" keys throws an ArrayIndexOutOfBoundsException

Open vlcoo opened this issue 1 month ago • 0 comments

Describe the bug If a function key is pressed (not F1-F12, rather, "Fn"-keys like Media Play/Pause, Volume Up/Down, Volume Mute, etc.), an ArrayIndexOutOfBoundsException is thrown during input handling.

To Reproduce Steps to reproduce the behavior:

  1. Run example code and keep window focused.
  2. Press a function key such as Media Play/Pause, Volume Up/Down or Volume Mute on your keyboard.
  3. Exception gets thrown and window becomes unresponsive;
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 512
	at com.raylib.java.core.Callbacks$KeyCallback.invoke(Callbacks.java:85)
	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:3438)
	at com.raylib.java.core.rCore.PollInputEvents(rCore.java:2907)
	at com.raylib.java.core.rCore.EndDrawing(rCore.java:976)
	at Main.main(Main.java:21)

Expected behavior Either handle the affected function keys just like any other keys, or ignore them. The way this exception appears is unexpected and can't be cleanly taken care of.

Desktop

  • OS: Windows 11 24H2

vlcoo avatar Jan 22 '25 03:01 vlcoo