diff options
-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 | ||||
-rw-r--r-- | core/res/res/values/attrs.xml | 19 | ||||
-rw-r--r-- | include/ui/KeycodeLabels.h | 48 |
5 files changed, 47 insertions, 57 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() diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index e8a1676..a12f21c 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -916,20 +916,11 @@ <enum name="KEYCODE_MEDIA_REWIND" value="89" /> <enum name="KEYCODE_MEDIA_FAST_FORWARD" value="90" /> <enum name="KEYCODE_MUTE" value="91" /> - <enum name="KEYCODE_FUNC_1" value="92" /> - <enum name="KEYCODE_FUNC_2" value="93" /> - <enum name="KEYCODE_FUNC_3" value="94" /> - <enum name="KEYCODE_FUNC_4" value="95" /> - <enum name="KEYCODE_FUNC_5" value="96" /> - <enum name="KEYCODE_FUNC_6" value="97" /> - <enum name="KEYCODE_FUNC_7" value="98" /> - <enum name="KEYCODE_FUNC_8" value="99" /> - <enum name="KEYCODE_QUECHAR" value="100" /> - <enum name="KEYCODE_USER1" value="101" /> - <enum name="KEYCODE_USER2" value="102" /> - <enum name="KEYCODE_USER3" value="103" /> - <enum name="KEYCODE_USER4" value="104" /> - <enum name="KEYCODE_USER5" value="105" /> + <enum name="KEYCODE_USER1" value="92" /> + <enum name="KEYCODE_USER2" value="93" /> + <enum name="KEYCODE_USER3" value="94" /> + <enum name="KEYCODE_USER4" value="95" /> + <enum name="KEYCODE_USER5" value="96" /> </attr> <!-- ***************************************************************** --> diff --git a/include/ui/KeycodeLabels.h b/include/ui/KeycodeLabels.h index 3c6877f..64b615e 100644 --- a/include/ui/KeycodeLabels.h +++ b/include/ui/KeycodeLabels.h @@ -114,20 +114,21 @@ static const KeycodeLabel KEYCODES[] = { { "MEDIA_REWIND", 89 }, { "MEDIA_FAST_FORWARD", 90 }, { "MUTE", 91 }, - { "FUNC_1", 92 }, - { "FUNC_2", 93 }, - { "FUNC_3", 94 }, - { "FUNC_4", 95 }, - { "FUNC_5", 96 }, - { "FUNC_6", 97 }, - { "FUNC_7", 98 }, - { "FUNC_8", 99 }, - { "QUECHAR", 100 }, - { "USER1", 101 }, - { "USER2", 102 }, - { "USER3", 103 }, - { "USER4", 104 }, - { "USER5", 105 }, + { "USER1", 92 }, + { "USER2", 93 }, + { "USER3", 94 }, + { "USER4", 95 }, + { "USER5", 96 }, + { "FUNC_1", 97 }, + { "FUNC_2", 98 }, + { "FUNC_3", 99 }, + { "FUNC_4", 100 }, + { "FUNC_5", 101 }, + { "FUNC_6", 102 }, + { "FUNC_7", 103 }, + { "FUNC_8", 104 }, + { "QUECHAR", 105 }, + { "BTN_MOUSE", 106 }, // NOTE: If you add a new keycode here you must also add it to: // (enum KeyCode, in this file) @@ -233,20 +234,11 @@ typedef enum KeyCode { kKeyCodeRewind = 89, kKeyCodeForward = 90, kKeyCodeMute = 91, - kKeyCodeFunc1 = 92, - kKeyCodeFunc2 = 93, - kKeyCodeFunc3 = 94, - kKeyCodeFunc4 = 95, - kKeyCodeFunc5 = 96, - kKeyCodeFunc6 = 97, - kKeyCodeFunc7 = 98, - kKeyCodeFunc8 = 99, - kKeyCodeQuechar = 100, - kKeyCodeUser1 = 101, - kKeyCodeUser2 = 102, - kKeyCodeUser3 = 103, - kKeyCodeUser4 = 104, - kKeyCodeUser5 = 105 + kKeyCodeUser1 = 92, + kKeyCodeUser2 = 93, + kKeyCodeUser3 = 94, + kKeyCodeUser4 = 95, + kKeyCodeUser5 = 96, } KeyCode; static const KeycodeLabel FLAGS[] = { |