diff options
author | Steve Kondik <shade@chemlab.org> | 2010-11-13 03:58:40 -0500 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2010-11-13 03:58:40 -0500 |
commit | ebb5e47760cc156fba6d6a93ad0dfaeb562f4771 (patch) | |
tree | 9edb0f5b6b85cd3891612b004defb0261179804b /core/java | |
parent | 691845d64f8a3964f66d4b32583a50f2861b1653 (diff) | |
download | frameworks_base-ebb5e47760cc156fba6d6a93ad0dfaeb562f4771.zip frameworks_base-ebb5e47760cc156fba6d6a93ad0dfaeb562f4771.tar.gz frameworks_base-ebb5e47760cc156fba6d6a93ad0dfaeb562f4771.tar.bz2 |
input: Fix keymapping and handle www/com key.
The keymappings derived when setting up for Espresso were
incorrect and causing problems on other keyboards like Vision. Corrected
this, and also added handling for the www/com key on Vision.
Change-Id: I4303c60498469a24f5ce2b4397b6cf822ac81f67
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/text/method/QwertyKeyListener.java | 6 | ||||
-rw-r--r-- | core/java/android/view/KeyCharacterMap.java | 12 | ||||
-rw-r--r-- | core/java/android/view/KeyEvent.java | 19 |
3 files changed, 22 insertions, 15 deletions
diff --git a/core/java/android/text/method/QwertyKeyListener.java b/core/java/android/text/method/QwertyKeyListener.java index b3926f2..7a1b6aa 100644 --- a/core/java/android/text/method/QwertyKeyListener.java +++ b/core/java/android/text/method/QwertyKeyListener.java @@ -106,6 +106,12 @@ public class QwertyKeyListener extends BaseKeyListener { return true; } + if (i == KeyCharacterMap.DOT_WWW_INPUT || i == KeyCharacterMap.DOT_COM_INPUT) { + content.replace(selStart, selEnd, selStart == 0 ? "www." : ".com"); + adjustMetaAfterKeypress(content); + return true; + } + if (i == KeyCharacterMap.HEX_INPUT) { int start; diff --git a/core/java/android/view/KeyCharacterMap.java b/core/java/android/view/KeyCharacterMap.java index 25958aa..2dec152 100644 --- a/core/java/android/view/KeyCharacterMap.java +++ b/core/java/android/view/KeyCharacterMap.java @@ -55,8 +55,18 @@ public class KeyCharacterMap */ public static final char PICKER_DIALOG_INPUT = '\uEF01'; + /** + * Private use character denoting a .com suffix + */ + public static final char DOT_COM_INPUT = '\uEF03'; + + /** + * Private use character denoting a www. prefix + */ + public static final char DOT_WWW_INPUT = '\uEF04'; + private static Object sLock = new Object(); - private static SparseArray<WeakReference<KeyCharacterMap>> sInstances + private static SparseArray<WeakReference<KeyCharacterMap>> sInstances = new SparseArray<WeakReference<KeyCharacterMap>>(); public static KeyCharacterMap load(int keyboard) diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java index b543b2c..05d2492 100644 --- a/core/java/android/view/KeyEvent.java +++ b/core/java/android/view/KeyEvent.java @@ -120,20 +120,11 @@ public class KeyEvent implements Parcelable { public static final int KEYCODE_MEDIA_REWIND = 89; public static final int KEYCODE_MEDIA_FAST_FORWARD = 90; public static final int KEYCODE_MUTE = 91; - public static final int KEYCODE_FUNC_1 = 92; - public static final int KEYCODE_FUNC_2 = 93; - public static final int KEYCODE_FUNC_3 = 94; - public static final int KEYCODE_FUNC_4 = 95; - public static final int KEYCODE_FUNC_5 = 96; - public static final int KEYCODE_FUNC_6 = 97; - public static final int KEYCODE_FUNC_7 = 98; - public static final int KEYCODE_FUNC_8 = 99; - public static final int KEYCODE_QUECHAR = 100; - public static final int KEYCODE_USER1 = 101; - public static final int KEYCODE_USER2 = 102; - public static final int KEYCODE_USER3 = 103; - public static final int KEYCODE_USER4 = 104; - public static final int KEYCODE_USER5 = 105; + public static final int KEYCODE_USER1 = 92; + public static final int KEYCODE_USER2 = 93; + public static final int KEYCODE_USER3 = 94; + public static final int KEYCODE_USER4 = 95; + public static final int KEYCODE_USER5 = 96; // NOTE: If you add a new keycode here you must also add it to: // isSystem() |