summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/render_widget_host_view_mac.h
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 20:34:24 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 20:34:24 +0000
commitbfabbaae87c820d3dbf18c4e576589859f66ea11 (patch)
tree4abcd39f2e80c48979ac60aef1880a4c1c907519 /chrome/browser/renderer_host/render_widget_host_view_mac.h
parent5ce27c24b9c5d78f2f5b7d414e5e96518fa8f59f (diff)
downloadchromium_src-bfabbaae87c820d3dbf18c4e576589859f66ea11.zip
chromium_src-bfabbaae87c820d3dbf18c4e576589859f66ea11.tar.gz
chromium_src-bfabbaae87c820d3dbf18c4e576589859f66ea11.tar.bz2
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. Review URL: http://codereview.chromium.org/293019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31287 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/render_widget_host_view_mac.h')
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_mac.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.h b/chrome/browser/renderer_host/render_widget_host_view_mac.h
index 99a9d47..9d6ffbb 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.h
@@ -44,6 +44,7 @@ class RWHVMEditCommandHelper;
NSString* toolTip_;
BOOL ignoreKeyEvents_;
+ scoped_nsobject<NSEvent> lastKeyPressedEvent_;
}
- (void)setCanBeKeyView:(BOOL)can;