diff options
| author | Leon Scroggins <scroggo@google.com> | 2009-12-08 10:44:28 -0500 |
|---|---|---|
| committer | Leon Scroggins <scroggo@google.com> | 2009-12-08 10:44:28 -0500 |
| commit | f65b50ddd2f7ed1205002d74082fff1ac2336d5c (patch) | |
| tree | 83586c8fa38480814ed51e5e5835bf25f085152f /src/com/android/browser/BrowserActivity.java | |
| parent | 80a56269482dcc071e1b413baf968509bd9da9fb (diff) | |
Allow long press MENU to open IME in Browser.
Pass MENU key up even if menu is already held down so the
IME can open due to long press.
Fixes http://b/issue?id=20306904
Diffstat (limited to 'src/com/android/browser/BrowserActivity.java')
| -rw-r--r-- | src/com/android/browser/BrowserActivity.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 46e6de1d..71ed2a16 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -2025,15 +2025,18 @@ public class BrowserActivity extends Activity @Override public boolean onKeyDown(int keyCode, KeyEvent event) { + // Even if MENU is already held down, we need to call to super to open + // the IME on long press. + if (KeyEvent.KEYCODE_MENU == keyCode) { + mMenuIsDown = true; + return super.onKeyDown(keyCode, event); + } // The default key mode is DEFAULT_KEYS_SEARCH_LOCAL. As the MENU is // still down, we don't want to trigger the search. Pretend to consume // the key and do nothing. if (mMenuIsDown) return true; switch(keyCode) { - case KeyEvent.KEYCODE_MENU: - mMenuIsDown = true; - break; case KeyEvent.KEYCODE_SPACE: // WebView/WebTextView handle the keys in the KeyDown. As // the Activity's shortcut keys are only handled when WebView |
