Closed salty-horse closed 10 years ago
Similarly, the W key gets stuck when I hit Command-W to close the tab in Firefox on Mac OS X. Not only does the tab not close, but also W (up) is continuously sent to the game until I press and release W again.
Thanks for reporting this!
On Fri, Jan 10, 2014 at 11:02 PM, Rory O’Kane notifications@github.comwrote:
Similarly, the W key gets stuck when I hit Command-W to close the tab in Firefox on Mac OS X. Not only does the tab not close, but also W (up) is continuously sent to the game until I press and release W again.
— Reply to this email directly or view it on GitHubhttps://github.com/increpare/PuzzleScript/issues/38#issuecomment-32075704 .
uh, this is moderately gross. if someone else wants to propose a fix for this, or explain to me how to fix it, I'm all ears. i guess reset all input when focus is regained, just don't know what handlers to attach to what. (the input code is in inputoutput.js). I already have an onkeyup action, which should tell you how to release keys.
alan, amazing. thanks so much. fixed.
This bug still exists in Chrome for Mac. If I open that game, hold right arrow, Ctrl-Tab to switch tabs, then switch back, then the key is stuck and the character keeps moving right until I hit right arrow again. However, the bug is now fixed in Firefox for Mac – the character is not moving when I switch back to the tab in Firefox.
Also, the problem with Command-W to close the tab not working still exists in Firefox for Mac. But it seems like it doesn’t happen in Chrome for Mac. I’ve created a separate issue for that, #51.
I think I've fixed this now - if you could check again for me, it'd be super super.
Yep, it’s fixed – the problem does not happen in Firefox 27, Chrome, or Safari 5.1 on my OS X 10.6 computer.
Thanks for letting me know! :)
If I start a PuzzleScript game and hold an arrow key and alt-tab to a different window, depress the key, then alt-tab back, PuzzleScript thinks the key is still pressed.
It will keep triggering events until you press the arrow again, so PuzzleScript receives the "keyup". Unfortunately that doesn't always work.
I've tested this with Firefox and Chrome on several games, e.g. http://www.puzzlescript.net/play.html?p=6851495 (Just start the game and press the right arrow)