diff options
author | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-01 04:49:06 +0000 |
---|---|---|
committer | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-01 04:49:06 +0000 |
commit | ad53baa575a30701cf26e77d748252c010fb96ab (patch) | |
tree | 168fccfcfe9852812f34c0675fdc8b0656cb6af5 /chrome/common/native_web_keyboard_event_linux.cc | |
parent | 29bba6f380ab785dc70d0632b62e98b47f5f4763 (diff) | |
download | chromium_src-ad53baa575a30701cf26e77d748252c010fb96ab.zip chromium_src-ad53baa575a30701cf26e77d748252c010fb96ab.tar.gz chromium_src-ad53baa575a30701cf26e77d748252c010fb96ab.tar.bz2 |
[Linux]Improve keyboard event handling code of RWHV.
Just like what Mac port already did, this CL changes the method to determine if a keyboard event should be processed by the browser to use a boolean field instead of setting the keyval of os_event to GDK_VoidSymbol. Because in some cases, GDK_VoidSymbol might be valid key value, for example ctrl-b on Arabic keyboard.
BUG=35117 Emacs key binding ctrl-b doesn't work in web page when using Arabic keyboard layout.
TEST=Enable Emacs key theme and switch to Arabic keyboard layout, then try ctrl-b (move cursor backwards) in web page's text area.
Review URL: http://codereview.chromium.org/661149
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/native_web_keyboard_event_linux.cc')
-rw-r--r-- | chrome/common/native_web_keyboard_event_linux.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/chrome/common/native_web_keyboard_event_linux.cc b/chrome/common/native_web_keyboard_event_linux.cc index c671654..571550e 100644 --- a/chrome/common/native_web_keyboard_event_linux.cc +++ b/chrome/common/native_web_keyboard_event_linux.cc @@ -32,11 +32,13 @@ void FreeEvent(GdkEventKey* event) { NativeWebKeyboardEvent::NativeWebKeyboardEvent() - : os_event(NULL) { + : os_event(NULL), + skip_in_browser(false) { } NativeWebKeyboardEvent::NativeWebKeyboardEvent(const GdkEventKey* native_event) - : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(native_event)) { + : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(native_event)), + skip_in_browser(false) { CopyEventTo(native_event, &os_event); } @@ -46,11 +48,14 @@ NativeWebKeyboardEvent::NativeWebKeyboardEvent(wchar_t character, : WebKeyboardEvent(WebInputEventFactory::keyboardEvent(character, state, time_stamp_seconds)), - os_event(NULL) { + os_event(NULL), + skip_in_browser(false) { } NativeWebKeyboardEvent::NativeWebKeyboardEvent( - const NativeWebKeyboardEvent& other) : WebKeyboardEvent(other) { + const NativeWebKeyboardEvent& other) + : WebKeyboardEvent(other), + skip_in_browser(other.skip_in_browser) { CopyEventTo(other.os_event, &os_event); } @@ -60,6 +65,9 @@ NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=( FreeEvent(os_event); CopyEventTo(other.os_event, &os_event); + + skip_in_browser = other.skip_in_browser; + return *this; } |