DescriptionSend keypress() events for ctrl-key and cmd-key in addition to keydown().
The ctrl-key behavior matches what Safari does: We first send a keydown for ctrl-key, and only if the key is not an emacs shortcut, we send a keypress.
The cmd-key behavior is slightly different from Safari: Safari triggers menu items after the keypress command has not been swallowed by javascript. We trigger menu items after keydown. That means that if the user hits cmd-key, we send a keydown and only send a keypress if the shortcut doesn't trigger a menu item. Safari always sends both keydown and keypress.
BUG=25249
TEST=Go to http://unixpapa.com/js/testkey.html . Hit ctrl-a, only a keydown should be generated. Hit ctrl-s, both keydown and keypress should be generated. Hit cmd-a, only a keydown should be generated. Hit cmd-shift-a, both keypress and keydown should be generated. Also, ctrl-1 now makes something a heading in google docs. Cmd-s and Cmd-f should still work in docs.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=31287
Patch Set 1 #Patch Set 2 : rebase tot, fix thinko #Patch Set 3 : remove logs #Patch Set 4 : logs begone! #Patch Set 5 : repeat both keydown and keypress if ctrl-1 is kept depressed #Patch Set 6 : rebase tot #Patch Set 7 : cleanup #Patch Set 8 : comment #
Total comments: 3
Patch Set 9 : address comments #Patch Set 10 : rebase tot #
Total comments: 6
Messages
Total messages: 13 (0 generated)
|