Please also read the follow up post. I have a workaround but it still seems there is a potential bug.
Problem Description
Keyboard entry using the CMD key modifier on Mac will cause the keyboard to become stuck after 2 or 3 keypresses.
Attach a Capx
The capx is rudimentary: here.
It's basically this:
Description of Capx
Displays keycodes pressed as reported by Construct 2 (Keyboard.LastKeyCode) in one text object and the Java (browser.execjs("event.code")) in another text box. Both methods of displaying the keycode are affected by this issue.
Steps to Reproduce Bug
- Go to this C2 Example on a Mac in Safari or Chrome.
- Press CMD + " then CMD+ \ without letting go of the command key. After doing this once or twice, you will then have to release all keys and press a random key once or twice to get a response again.
Observed Result
Keyboard input will become "stuck" after typing a couple of combos. "Stuck" meaning it will require the user to release all keys and type 1 or 2 random keystrokes until there is keyboard response again.
This Mac-specific issue does not occur when doing the same test with the Shift, Alt/Option or Control keys.
Expected Result
The CMD modifier shouldn't cause keyboard input to "stick". It should behave as the other modifier keys do. I was thinking that this may be occurring at the OS level, but if you go to keycode.info, you can type CMD + " and CMD + \ back and forth all day and it won't "get stuck". This little app listens with .onkeydown.
Why am I so worried about this? The overall purpose is for an app (currently in beta) that tests user knowledge of keyboard shortcuts for a popular audio program.
Web demo is here, it's currently in beta in the Apple and Google Play stores. I need to have an nw.js version that accepts keyboard input, though, wherein this issue makes the app rather unusable.
Affected Browsers
This happens on Mac in Safari, Chrome or nw.js. I have not found a browser/version where this does not occur on Mac. I only care about Chromium/nw.js
Operating System and Service Pack
MacOS High Sierra.
Construct 2 Version ID
It happens in either C2 (R250) or C3 (the free version).
Thanks!
-Steve