Bug 67757

Summary: event.keyCode not correct for onkeypress handler with command and shift modifiers
Product: WebKit Reporter: Ceri Morgan <cerimorgan>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: ap, shinyak
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac (Intel)   
OS: OS X 10.7   
Attachments:
Description Flags
Test case that can be used to see event.keyCode for various keypresses none

Ceri Morgan
Reported 2011-09-07 20:42:54 PDT
Created attachment 106695 [details] Test case that can be used to see event.keyCode for various keypresses When examining the event.keyCode in an onkeypress event handler, the shift key is ignored when the command key is also pressed. For example, here are the keyCode values I get when hitting the following keystrokes: a - 97 shift a - 65 command a - 97 command shift a - 97 For the last keystroke, I would expect to get a keyCode of 65. The modifiers are correctly set on the event object, but due to different keyboard layouts across the world, it's dangerous to assume, for example, that command 7 results in an ampersand.
Attachments
Test case that can be used to see event.keyCode for various keypresses (506 bytes, text/html)
2011-09-07 20:42 PDT, Ceri Morgan
no flags
Alexey Proskuryakov
Comment 1 2011-09-08 10:52:17 PDT
This is what the U.S. keyboard layout has in its Cmd+Shift plane. You can verify this by opening the Keyboard panel (which can be enabled via Mac OS X Keyboard preferences pane). Cmd and Cmd+Shift panes both have lowercase letters. We don't have any information about key presses besides what the OS tell us based on keyboard layout, so there is no practical way for us to change this behavior.
Note You need to log in before you can comment on or make changes to this bug.