From b2c8432fd886da77e978743883502c5bbde744d2 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Fri, 29 Jun 2012 12:06:03 -0700 Subject: [PATCH] Bug 768727 - Send '&' as composition string because some Gingerbread VKBs incorrectly map '&' key events. r=blassey --- mobile/android/base/GeckoInputConnection.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mobile/android/base/GeckoInputConnection.java b/mobile/android/base/GeckoInputConnection.java index df72cd7460c..d217d913462 100644 --- a/mobile/android/base/GeckoInputConnection.java +++ b/mobile/android/base/GeckoInputConnection.java @@ -639,12 +639,12 @@ public class GeckoInputConnection if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) { switch (inputChar) { case '&': - // Gingerbread's KeyCharacterMap would return ALT+7, but we want SHIFT+7. - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { - return createKeyDownKeyUpEvents(KeyEvent.KEYCODE_7, KeyEvent.META_SHIFT_ON); - } - // Froyo's KeyCharacterMap will return the correct '&' key events below. - break; + // Some Gingerbread devices' KeyCharacterMaps return ALT+7 instead of SHIFT+7, + // but some devices like the Droid Bionic treat SHIFT+7 as '7'. So just return + // null and onTextChanged() will send "&" as a composition string instead of + // KEY_DOWN + KEY_UP event pair. This may break web content listening for '&' + // key events, but they will still receive "&" input event. + return null; case '<': case '>':