diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 03:13:31 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 03:13:31 +0000 |
commit | 3ae1feb620daffbdf65d4b11038268da2e14090e (patch) | |
tree | d496395a3a932cd83618c9ee9c68e0f5113b8f13 /chrome/common/native_web_keyboard_event.h | |
parent | 034b3c6d0acaed4260b255c24a853bd92fd7e4df (diff) | |
download | chromium_src-3ae1feb620daffbdf65d4b11038268da2e14090e.zip chromium_src-3ae1feb620daffbdf65d4b11038268da2e14090e.tar.gz chromium_src-3ae1feb620daffbdf65d4b11038268da2e14090e.tar.bz2 |
Make backspace not go back while IME is active.
Linux does this in GtkIMContextWrapper::ProcessFilteredKeyPressEvent() by setting hardware_keycode to 0. It's a pain to change an NSEvent, so I just added a bool "skip" to NativeWebKeybordEvent and set it to "true" for rawkeydowns while ime is active.
BUG=25000
TEST=Open webpage. Focus text field. Type something, hit backspace. Text should be deleted. Focus background, hit backspace. Browser should go back one page. Focus text field, start IME (either by going to syspref->international->input menu and enabling e.g. "Kotoeri" and then selecting this in the top right corner and typing a single "a", or by just activating dead key ime on an us layout by hitting opt-u, opt-i, or opt-e), hit backspace. Browser should not go back but end IME mode.
Review URL: http://codereview.chromium.org/295003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/native_web_keyboard_event.h')
-rw-r--r-- | chrome/common/native_web_keyboard_event.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/common/native_web_keyboard_event.h b/chrome/common/native_web_keyboard_event.h index 87f5a90..654c38b 100644 --- a/chrome/common/native_web_keyboard_event.h +++ b/chrome/common/native_web_keyboard_event.h @@ -48,6 +48,12 @@ struct NativeWebKeyboardEvent : public WebKit::WebKeyboardEvent { MSG os_event; #elif defined(OS_MACOSX) NSEvent* os_event; + + // True if the browser should ignore this event if it's not handled by the + // renderer. This happens for RawKeyDown events that are created while IME is + // active and is necessary to prevent backspace from doing "history back" if + // it is hit in ime mode. + bool skip_in_browser; #elif defined(OS_LINUX) GdkEventKey* os_event; #endif |