-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some missing keys to getEventKey #2192
Conversation
What's the cross-browser support story here? cc @syranide |
@zpao Uncertain. IIRC If someone can verify the key codes with a physical keyboard AND verify that there are no conflicts (I only have access to PC at current) then I don't see why not. |
Good point, I'll have to test on a Windows PC. I've got an old laptop at home somewhere, I'll try to test it out. I was using a Mac while writing this code. I have one of the Apple USB keyboards which is the only keyboard I've ever seen F13-F19 on, and they seemed to work. The key codes I used for F13-F19 correspond to the key codes listed in Mozilla's documentation (see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.keyCode) |
F20 through F24 are listed in Mozilla's documentation (key code 131 through 135) so I could add those too, I just have no way to test them on an actual keyboard. |
@Daniel15 Just checked, 91 maps to Windows Key and 93 maps to Context Menu on PC (which is what's vjeux reported at #607 (comment) and why those keys were removed). F13-F24 is probably sound, my previous experience with Win32 APIs doesn't suggest that they can/have been repurposed for alternative uses http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx |
Okay, so in that case I think 91 should actually map to Should we just leave 93 out or should it be Also what is the keyboard code for the right Windows key in Windows? That should be This reminds me of keyboard handling in IE 5. You'd think things would have gotten better by now :( |
@Daniel15 From what I understand My understanding is that 91/93 are OS/platform-specific. I imagine we could technically use |
Linux calls it the |
I'm very confident http://www.w3.org/TR/2014/WD-DOM-Level-3-Events-20140925/#keys-unicode Also, the url below has mapped |
I haven't had time to revisit this so I'm just going to close the pull request. Feel free to repurpose my changes. These events seem extremely inconsistent across browsers at the moment which severely limits their use in real apps. |
@spicyj |
getEventKey
was missing a few keys that are correctly handled by Firefox's implementation of the DOM3 keyboard events.References:
Firefox key list: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.key
Key codes: http://www.aspdotnet-suresh.com/2013/09/character-keycodes-javascript-keyboard-keycodes.html