Bug 685537 - [HKb] Fn key + key is not working properly. r=jchen
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 20 Sep 2011 17:35:38 +0900
changeset 77180 ceafc572c5ad64d7cdf7fc6567cfddb3b13e687e
parent 77179 c0f7ee4b3358dc4b51ef2f3f01867098fa784cac
child 77181 5a3e49205389d413ed5201a51399300d035b7bf1
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersjchen
bugs685537
milestone9.0a1
Bug 685537 - [HKb] Fn key + key is not working properly. r=jchen
embedding/android/GeckoSurfaceView.java
--- a/embedding/android/GeckoSurfaceView.java
+++ b/embedding/android/GeckoSurfaceView.java
@@ -644,17 +644,18 @@ class GeckoSurfaceView
                 if ((event.getFlags() & KeyEvent.FLAG_EDITOR_ACTION) != 0 &&
                     mIMEActionHint.equalsIgnoreCase("next"))
                     event = new KeyEvent(event.getAction(), KeyEvent.KEYCODE_TAB);
                 break;
             default:
                 break;
         }
 
-        if (isPreIme && mIMEState != IME_STATE_DISABLED)
+        if (isPreIme && mIMEState != IME_STATE_DISABLED &&
+            (event.getMetaState() & KeyEvent.META_ALT_ON) == 0)
             // Let active IME process pre-IME key events
             return false;
 
         // KeyListener returns true if it handled the event for us.
         if (mIMEState == IME_STATE_DISABLED ||
             keyCode == KeyEvent.KEYCODE_ENTER ||
             keyCode == KeyEvent.KEYCODE_DEL ||
             (event.getFlags() & KeyEvent.FLAG_SOFT_KEYBOARD) != 0 ||
@@ -673,17 +674,18 @@ class GeckoSurfaceView
             case KeyEvent.KEYCODE_BACK:
                 if (!event.isTracking() || event.isCanceled())
                     return false;
                 break;
             default:
                 break;
         }
 
-        if (isPreIme && mIMEState != IME_STATE_DISABLED)
+        if (isPreIme && mIMEState != IME_STATE_DISABLED &&
+            (event.getMetaState() & KeyEvent.META_ALT_ON) == 0)
             // Let active IME process pre-IME key events
             return false;
 
         if (mIMEState == IME_STATE_DISABLED ||
             keyCode == KeyEvent.KEYCODE_ENTER ||
             keyCode == KeyEvent.KEYCODE_DEL ||
             (event.getFlags() & KeyEvent.FLAG_SOFT_KEYBOARD) != 0 ||
             !mKeyListener.onKeyUp(this, mEditable, keyCode, event))