open-builder
open-builder copied to clipboard
Pressing ` or Caps-Lock causes the error screen to pop up
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
- Run the game
- Press caps lock or `
- See the error screen
Expected behavior
Nothing should happen
Screenshots

Desktop (please complete the following information):
Windows 10
Additional context
No idea
Also caused by the print screen key, f11 and keys related to the sound.
So... I hope no one minds me commenting here, just thought I'd give it a shot.
I noticed the print screen issue while trying to take some screenshots of my progress on a different issue. I took a few minutes to just dig around in the debugger, and it seems as if e.key.code is unknown at -1, and thus causes an array bounds error.
...

So, I played around with it a little more, and used some debug info to find this...

The key takeaway here is at the bottom, where e.key.code is unknown (-1).
Just to test, I started printing e.key.code. I did a few test prints, and then tried prtScm, and got...
The value of -1 then, of course, will cause an array out of bounds error.
I'm sure I'm just stating the obvious, but I thought it's better to have it set in stone than not at all. We might be able to deal with this by ignoring any unknown codes.
Thank you for all your time! Have a wonderful day!