From e18bd3e323e7d7448677bb66e8149eea0169c771 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 6 Dec 2010 12:12:27 +0900 Subject: [PATCH] Fix voice key on phone device This change, - changes voice key code back to -102 - renames some key code names and method names - adds mic_slash_holo to drawable-hdpi Change-Id: I8be3a20921f472ece4298edad2d275f29a7e4955 --- java/res/drawable-hdpi/mic_slash_holo.png | Bin 0 -> 4317 bytes java/res/values/keycodes.xml | 2 +- java/res/values/strings.xml | 2 +- .../inputmethod/keyboard/Keyboard.java | 13 +++++++------ .../keyboard/LatinKeyboardView.java | 4 ++-- .../inputmethod/keyboard/PointerTracker.java | 2 +- .../android/inputmethod/latin/LatinIME.java | 18 +++++++++--------- 7 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 java/res/drawable-hdpi/mic_slash_holo.png diff --git a/java/res/drawable-hdpi/mic_slash_holo.png b/java/res/drawable-hdpi/mic_slash_holo.png new file mode 100644 index 0000000000000000000000000000000000000000..8108b6e137b47a97f1d0406358892d0d7f86c8c8 GIT binary patch literal 4317 zcmbVQc|25m{~v4C$WE5AR|d0TWK)NM2bx6L6%61c*%ZneSUx3*Yn5kyv{k_?el(r_Sbp6PMXzO6Mh~k9smHqZ)R$2!yHk} z$BK)S`8FN#6k!gMG>ikymh4FjBTz^HG?DC10-6O7yht`A0x=@Ei=+zxuzC8}InW&N z7AOyLfCk}EMk72Rh=~RObkBqb5j^}zG@v`l%O_AzVZEtY0q8^2Q?S>KR3P1Vc3;P<4n73I;`i!N9*R1*SF% z(Gz83jQvX&bET)?O``>&G&RG*!ZgBQ8f1!>CIpE@9&$jT>P!iBYD6H75Uw6bRs6+Z zOrm;Fe1d2`mFdBd|~i8Vg0hF>piJFRWQ0l|~5kApO$o!_@m17V$r^C?g7qKqFJ^$YlRt z6=3B}rje=MSYk|>d2n+(l zf}!9;zY#hRELvL&i_tPdBfuCVg}<=G|4+;`nZ{@y7RUc7mS0=U3Oty@8#1HJKm@v%MV z5R^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zXEkJ?{j@b2Kn~E(a2Ga^x~K7 zEivi`DqcoT5u%9x#k~2D;ahPXT3zDrN>n`?fU%!VR$k4h2D#=>ebT4>__l$Te*!C4 zmbT!;f$uBzM`7nzE4;VNIn9nfsIRC9L?#!17#70)oBm}Z$frL_JfRKrCe}N~+}xZO z<4UPfMQTO3zzt=o1n1bXB+SkZ%MQx0DS17g6d+5CP|oiaGdwcGIUcI6COJ*DZ7p8bxE*4+!d zdS!VqjO|dH*M5mleqdGv1AXh#>gsC7z$pwe^q`ygw0KuS+2AQQ=HOKVTO}lOJ?#Nk z@wN>4wj-S@eB-yaZ9#WY;7QnQdKhlwOGz!RPXEKv6Mftb8@mA`+ksT-ru-ZQe~YtM zv%4k?qi!?pf!xBuMvFF2R9uSZwW<{U5Lq4j1MkFBD`|HIFl}fuR7@_dPY!kwXm>ZU zw;$u4d?n;@R9hv+u}8A4`Pkd{<}lc-^hvh$Ol97O$>}jcrM?_2p=VtzndxyD~1&h?|mx*umJ>FqMXs5UyBcaIGAD18dn&)CH@C4 C#gRt< literal 0 HcmV?d00001 diff --git a/java/res/values/keycodes.xml b/java/res/values/keycodes.xml index 54fa61026..6c18cb42a 100644 --- a/java/res/values/keycodes.xml +++ b/java/res/values/keycodes.xml @@ -19,13 +19,13 @@ --> + 9 10 32 -1 -2 -5 - -100 -102 diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml index bd17bd289..78de94f95 100644 --- a/java/res/values/strings.xml +++ b/java/res/values/strings.xml @@ -410,7 +410,7 @@ Serbian Keyboard Swedish Keyboard - Czech Voice + Czech Voice German Voice English (Australia) Voice English (Great Britain) Voice diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java index 380198663..6a1d62efe 100644 --- a/java/src/com/android/inputmethod/keyboard/Keyboard.java +++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java @@ -59,25 +59,26 @@ public class Keyboard { public static final int EDGE_TOP = 0x04; public static final int EDGE_BOTTOM = 0x08; + /** Some common keys code. These should be aligned with values/keycodes.xml */ public static final int CODE_ENTER = '\n'; public static final int CODE_TAB = '\t'; public static final int CODE_SPACE = ' '; public static final int CODE_PERIOD = '.'; + /** Special keys code. These should be aligned with values/keycodes.xml */ public static final int CODE_SHIFT = -1; - public static final int CODE_MODE_CHANGE = -2; + public static final int CODE_SWITCH_ALPHA_SYMBOL = -2; public static final int CODE_CANCEL = -3; public static final int CODE_DONE = -4; public static final int CODE_DELETE = -5; public static final int CODE_ALT = -6; - - public static final int CODE_OPTIONS = -100; - public static final int CODE_OPTIONS_LONGPRESS = -101; + public static final int CODE_SETTINGS = -100; + public static final int CODE_SETTINGS_LONGPRESS = -101; + // TODO: remove this once LatinIME stops referring to this. + public static final int CODE_VOICE = -102; public static final int CODE_CAPSLOCK = -103; public static final int CODE_NEXT_LANGUAGE = -104; public static final int CODE_PREV_LANGUAGE = -105; - // TODO: remove this once LatinIME stops referring to this. - public static final int CODE_VOICE = -109; /** Horizontal gap default for all rows */ private int mDefaultHorizontalGap; diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java index 4e0caa1f6..5c1c62b05 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java @@ -88,8 +88,8 @@ public class LatinKeyboardView extends KeyboardView { @Override protected boolean onLongPress(Key key) { int primaryCode = key.mCodes[0]; - if (primaryCode == Keyboard.CODE_OPTIONS) { - return invokeOnKey(Keyboard.CODE_OPTIONS_LONGPRESS); + if (primaryCode == Keyboard.CODE_SETTINGS) { + return invokeOnKey(Keyboard.CODE_SETTINGS_LONGPRESS); } else if (primaryCode == '0' && getLatinKeyboard().isPhoneKeyboard()) { // Long pressing on 0 in phone number keypad gives you a '+'. return invokeOnKey('+'); diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index a1210f240..8570491f8 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -208,7 +208,7 @@ public class PointerTracker { return false; int primaryCode = key.mCodes[0]; return primaryCode == Keyboard.CODE_SHIFT - || primaryCode == Keyboard.CODE_MODE_CHANGE; + || primaryCode == Keyboard.CODE_SWITCH_ALPHA_SYMBOL; } public boolean isModifier() { diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 5bf635fd3..702731e6d 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1050,7 +1050,7 @@ public class LatinIME extends InputMethodService } } - private void onOptionKeyPressed() { + private void onSettingsKeyPressed() { if (!isShowingOptionDialog()) { if (LatinIMEUtil.hasMultipleEnabledIMEsOrSubtypes(mImm)) { showOptionsMenu(); @@ -1060,7 +1060,7 @@ public class LatinIME extends InputMethodService } } - private void onOptionKeyLongPressed() { + private void onSettingsKeyLongPressed() { if (!isShowingOptionDialog()) { if (LatinIMEUtil.hasMultipleEnabledIMEsOrSubtypes(mImm)) { mImm.showInputMethodPicker(); @@ -1096,7 +1096,7 @@ public class LatinIME extends InputMethodService if (!distinctMultiTouch) switcher.toggleShift(); break; - case Keyboard.CODE_MODE_CHANGE: + case Keyboard.CODE_SWITCH_ALPHA_SYMBOL: // Symbol key is handled in onPress() when device has distinct multi-touch panel. if (!distinctMultiTouch) switcher.changeKeyboardMode(); @@ -1106,11 +1106,11 @@ public class LatinIME extends InputMethodService handleClose(); } break; - case Keyboard.CODE_OPTIONS: - onOptionKeyPressed(); + case Keyboard.CODE_SETTINGS: + onSettingsKeyPressed(); break; - case Keyboard.CODE_OPTIONS_LONGPRESS: - onOptionKeyLongPressed(); + case Keyboard.CODE_SETTINGS_LONGPRESS: + onSettingsKeyLongPressed(); break; case Keyboard.CODE_NEXT_LANGUAGE: toggleLanguage(false, true); @@ -1929,7 +1929,7 @@ public class LatinIME extends InputMethodService final boolean distinctMultiTouch = switcher.hasDistinctMultitouch(); if (distinctMultiTouch && primaryCode == Keyboard.CODE_SHIFT) { switcher.onPressShift(); - } else if (distinctMultiTouch && primaryCode == Keyboard.CODE_MODE_CHANGE) { + } else if (distinctMultiTouch && primaryCode == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) { switcher.onPressSymbol(); } else { switcher.onOtherKeyPressed(); @@ -1944,7 +1944,7 @@ public class LatinIME extends InputMethodService final boolean distinctMultiTouch = switcher.hasDistinctMultitouch(); if (distinctMultiTouch && primaryCode == Keyboard.CODE_SHIFT) { switcher.onReleaseShift(); - } else if (distinctMultiTouch && primaryCode == Keyboard.CODE_MODE_CHANGE) { + } else if (distinctMultiTouch && primaryCode == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) { switcher.onReleaseSymbol(); } }