diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-03 08:35:22 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-03 08:35:22 +0000 |
commit | a5631c1fc2466f410d30db24774046b048bc4e43 (patch) | |
tree | 5cd16472fb25607d6e6af2f4912388a1212b0600 /webkit/tools/test_shell/mac | |
parent | 7d9ad79c7deba1fa866d1b67e6dfea3a9ca55be6 (diff) | |
download | chromium_src-a5631c1fc2466f410d30db24774046b048bc4e43.zip chromium_src-a5631c1fc2466f410d30db24774046b048bc4e43.tar.gz chromium_src-a5631c1fc2466f410d30db24774046b048bc4e43.tar.bz2 |
A quick fix for Issue 20161
My r22262 changed the code that handles keyboard events dramatically, and this prevent TestShell from inputting characters. This change just sends Char events to emulate keyboard events. (We need to implement the NSTextInput protocol for TestShell, though.)
BUG=20161 "Keyboard doesn't work in Mac TestShell"
TEST=Run TestShell on Mac.
Review URL: http://codereview.chromium.org/183027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/mac')
-rw-r--r-- | webkit/tools/test_shell/mac/webwidget_host.mm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/webkit/tools/test_shell/mac/webwidget_host.mm b/webkit/tools/test_shell/mac/webwidget_host.mm index 9447544..5be3a2a 100644 --- a/webkit/tools/test_shell/mac/webwidget_host.mm +++ b/webkit/tools/test_shell/mac/webwidget_host.mm @@ -255,7 +255,15 @@ void WebWidgetHost::WheelEvent(NSEvent *event) { } void WebWidgetHost::KeyEvent(NSEvent *event) { - webwidget_->handleInputEvent(WebInputEventFactory::keyboardEvent(event)); + WebKeyboardEvent keyboard_event(WebInputEventFactory::keyboardEvent(event)); + webwidget_->handleInputEvent(keyboard_event); + if ([event type] == NSKeyDown) { + // Send a Char event here to emulate the keyboard events. + // TODO(hbono): Bug 20852 <http://crbug.com/20852> implement the + // NSTextInput protocol and remove this code. + keyboard_event.type = WebInputEvent::Char; + webwidget_->handleInputEvent(keyboard_event); + } } void WebWidgetHost::SetFocus(bool enable) { |