Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Issue 293019: Send keypress() events for ctrl-key and cmd-key in addition to keydown() (Closed)

Created:
11 years, 2 months ago by Nico
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, arv (Not doing code reviews)
Visibility:
Public.

Description

Send 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -1 line) Patch
M chrome/browser/renderer_host/render_widget_host_view_mac.h View 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 5 6 7 8 4 chunks +26 lines, -1 line 6 comments Download

Messages

Total messages: 13 (0 generated)
arv (Not doing code reviews)
I don't know much about Cocoa but it is important that both keydown and keypress ...
11 years, 2 months ago (2009-10-20 02:47:25 UTC) #1
Mark Mentovai
keydown repeat? Really?
11 years, 2 months ago (2009-10-20 03:47:43 UTC) #2
Nico
On 2009/10/20 03:47:43, Mark Mentovai wrote: > keydown repeat? Really? http://www.quirksmode.org/dom/events/keys.html suggests that "Yes, keydown ...
11 years, 2 months ago (2009-10-20 04:37:33 UTC) #3
Nico
…and I just wanted to reply to mark's comment, not send this out for review, ...
11 years, 2 months ago (2009-10-20 04:39:59 UTC) #4
Nico
11 years, 1 month ago (2009-11-06 17:48:32 UTC) #5
Nico
James, Jeremy, Avi: This is ready for review. Arv: FYI.
11 years, 1 month ago (2009-11-06 17:50:33 UTC) #6
Avi (use Gerrit)
http://codereview.chromium.org/293019/diff/11001/11003 File chrome/browser/renderer_host/render_widget_host_view_mac.mm (right): http://codereview.chromium.org/293019/diff/11001/11003#newcode669 Line 669: // event for that case. Note that his ...
11 years, 1 month ago (2009-11-06 18:15:49 UTC) #7
Nico
I also want to point out the following comment from WebHTMLView: // FIXME: interpretKeyEvents doesn't ...
11 years, 1 month ago (2009-11-06 19:19:02 UTC) #8
Avi (use Gerrit)
LG
11 years, 1 month ago (2009-11-06 20:18:55 UTC) #9
pink (ping after 24hrs)
drive-by questions. http://codereview.chromium.org/293019/diff/12003/12005 File chrome/browser/renderer_host/render_widget_host_view_mac.mm (right): http://codereview.chromium.org/293019/diff/12003/12005#newcode30 Line 30: static inline int ToWebKitModifiers(NSUInteger flags) { ...
11 years, 1 month ago (2009-11-11 15:46:16 UTC) #10
pink (ping after 24hrs)
drive-by questions. http://codereview.chromium.org/293019/diff/12003/12005 File chrome/browser/renderer_host/render_widget_host_view_mac.mm (right): http://codereview.chromium.org/293019/diff/12003/12005#newcode30 Line 30: static inline int ToWebKitModifiers(NSUInteger flags) { ...
11 years, 1 month ago (2009-11-11 15:46:43 UTC) #11
Nico
Changes in http://codereview.chromium.org/389016 . http://codereview.chromium.org/293019/diff/12003/12005 File chrome/browser/renderer_host/render_widget_host_view_mac.mm (right): http://codereview.chromium.org/293019/diff/12003/12005#newcode30 Line 30: static inline int ToWebKitModifiers(NSUInteger ...
11 years, 1 month ago (2009-11-12 00:11:16 UTC) #12
jeremy
11 years, 1 month ago (2009-11-12 06:56:19 UTC) #13
LGTM

Powered by Google App Engine
This is Rietveld 408576698