Bug 795224 - no more backspace nor arrows on the deck Asus Transformer. r=cpeterson
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 02 Oct 2012 13:35:53 +0900
changeset 108977 ac5c29ec176b7492e4b60d2991940ef605eaf849
parent 108976 42a7cb309ca13cfc55d1082e0cddf2fa563fdbe2
child 108978 064bf6c9fe165ae35222a403eeab7e0a55e50992
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewerscpeterson
bugs795224
milestone18.0a1
Bug 795224 - no more backspace nor arrows on the deck Asus Transformer. r=cpeterson
mobile/android/base/GeckoInputConnection.java
--- a/mobile/android/base/GeckoInputConnection.java
+++ b/mobile/android/base/GeckoInputConnection.java
@@ -880,16 +880,19 @@ class GeckoInputConnection
             }
         }
 
         resetCompositionState();
         return this;
     }
 
     public boolean onKeyPreIme(int keyCode, KeyEvent event) {
+        if (hasBuggyHardwareKeyboardLayout())
+            return false;
+
         switch (event.getAction()) {
             case KeyEvent.ACTION_DOWN:
                 return processKeyDown(keyCode, event);
             case KeyEvent.ACTION_UP:
                 return processKeyUp(keyCode, event);
             case KeyEvent.ACTION_MULTIPLE:
                 return onKeyMultiple(keyCode, event.getRepeatCount(), event);
         }
@@ -900,19 +903,16 @@ class GeckoInputConnection
         return processKeyDown(keyCode, event);
     }
 
     private boolean processKeyDown(int keyCode, KeyEvent event) {
         if (DEBUG) {
             Log.d(LOGTAG, "IME: processKeyDown(keyCode=" + keyCode + ", event=" + event + ")");
         }
 
-        if (hasBuggyHardwareKeyboardLayout())
-            return false;
-
         if (keyCode > KeyEvent.getMaxKeyCode())
             return false;
 
         switch (keyCode) {
             case KeyEvent.KEYCODE_MENU:
             case KeyEvent.KEYCODE_BACK:
             case KeyEvent.KEYCODE_VOLUME_UP:
             case KeyEvent.KEYCODE_VOLUME_DOWN:
@@ -957,19 +957,16 @@ class GeckoInputConnection
         return processKeyUp(keyCode, event);
     }
 
     private boolean processKeyUp(int keyCode, KeyEvent event) {
         if (DEBUG) {
             Log.d(LOGTAG, "IME: processKeyUp(keyCode=" + keyCode + ", event=" + event + ")");
         }
 
-        if (hasBuggyHardwareKeyboardLayout())
-            return false;
-
         if (keyCode > KeyEvent.getMaxKeyCode())
             return false;
 
         switch (keyCode) {
             case KeyEvent.KEYCODE_BACK:
             case KeyEvent.KEYCODE_SEARCH:
             case KeyEvent.KEYCODE_MENU:
                 return false;
@@ -987,18 +984,16 @@ class GeckoInputConnection
             !keyListener.onKeyUp(view, mEditable, keyCode, event)) {
             GeckoAppShell.sendEventToGecko(GeckoEvent.createKeyEvent(event));
         }
 
         return true;
     }
 
     public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) {
-        if (hasBuggyHardwareKeyboardLayout())
-            return false;
         GeckoAppShell.sendEventToGecko(GeckoEvent.createKeyEvent(event));
         return true;
     }
 
     public boolean onKeyLongPress(int keyCode, KeyEvent event) {
         View v = getView();
         switch (keyCode) {
             case KeyEvent.KEYCODE_MENU: