open-builder icon indicating copy to clipboard operation
open-builder copied to clipboard

Pressing ` or Caps-Lock causes the error screen to pop up

Open Hopson97 opened this issue 5 years ago • 2 comments

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Run the game
  2. Press caps lock or `
  3. See the error screen

Expected behavior

Nothing should happen

Screenshots

image

Desktop (please complete the following information):

Windows 10

Additional context

No idea

Hopson97 avatar Mar 26 '20 21:03 Hopson97

Also caused by the print screen key, f11 and keys related to the sound.

gml16 avatar Mar 27 '20 12:03 gml16

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.

... Screenshot (24)

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

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... Screenshot (28) 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!

georgew79 avatar Mar 27 '20 13:03 georgew79