
Leaving "Back" key unbound causes all unknown keys to trigger it.
thecolonel63 opened this issue ยท 0 comments
I regularly use the "Media Play / Pause" keyboard key to play and pause my music in another tab while playing. I noticed that whenever I do this, my chat window closes, as well as any other GUI I happen to have open when I do so. I checked the stacktrace of the method that closes the GUI and found that it's caused by Quark not checking if the "Back" key is unbound before attempting to close the GUI.
This affects every key not directly known to GLFW, primarily affecting all media keys. Of my testing, I've noticed that it affects Play / Pause, Mute, Volume Up, Volume Down, Skip Back, Skip Forward, and many more. All of these cause the "Back" keybind to misfire.
The issue is directly found here:
In this specific case, this issue may be fixed via the following code change:
- if(backKey.getKey().getType() == Type.MOUSE && btn != GLFW.GLFW_MOUSE_BUTTON_LEFT && btn == backKey.getKey().getValue())
+ if(backKey.getKey().getType() == Type.MOUSE && btn != GLFW.GLFW_MOUSE_BUTTON_LEFT && btn == backKey.getKey().getValue() && backKey.getKey().getValue() != GLFW.GLFW_KEY_UNKNOWN)
I should note that this same logical flow error of not checking if the key is bound may be present in other situations as well. I have not personally checked for this, but I suggest that you do.