aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-27 19:06:45 +0900
committerJean Chalard <jchalard@google.com>2014-01-23 13:10:02 +0900
commiteb6d41a525b08c1dc347e604e366021a807a367c (patch)
tree53c582eeccbfd6a5db3686155c3f195d386a6eb4 /java/src/com/android/inputmethod/latin
parentab80b41a0dee298837b1358457768ee5ac0fc79e (diff)
downloadlatinime-eb6d41a525b08c1dc347e604e366021a807a367c.tar.gz
latinime-eb6d41a525b08c1dc347e604e366021a807a367c.tar.xz
latinime-eb6d41a525b08c1dc347e604e366021a807a367c.zip
[IL67] Externalize a call to the keyboard switcher
Bug: 8636060 Change-Id: Ib13a54854e30afb79217a0a1f2aeca50a95ba155
Diffstat (limited to 'java/src/com/android/inputmethod/latin')
-rw-r--r--java/src/com/android/inputmethod/latin/Constants.java3
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java15
-rw-r--r--java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java15
3 files changed, 22 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/latin/Constants.java b/java/src/com/android/inputmethod/latin/Constants.java
index 77e99bfba..0477133d7 100644
--- a/java/src/com/android/inputmethod/latin/Constants.java
+++ b/java/src/com/android/inputmethod/latin/Constants.java
@@ -216,8 +216,9 @@ public final class Constants {
public static final int CODE_LANGUAGE_SWITCH = -10;
public static final int CODE_EMOJI = -11;
public static final int CODE_SHIFT_ENTER = -12;
+ public static final int CODE_SYMBOL_SHIFT = -13;
// Code value representing the code is not specified.
- public static final int CODE_UNSPECIFIED = -13;
+ public static final int CODE_UNSPECIFIED = -14;
public static boolean isLetterCode(final int code) {
return code >= CODE_SPACE;
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 399d4917c..97fa90eec 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1260,7 +1260,20 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// this transformation, it should be done already before calling onCodeInput.
final int keyX = mainKeyboardView.getKeyX(x);
final int keyY = mainKeyboardView.getKeyY(y);
- mInputLogic.onCodeInput(codePoint, keyX, keyY, mHandler, mKeyboardSwitcher,
+ final int codeToSend;
+ if (Constants.CODE_SHIFT == codePoint) {
+ // TODO: Instead of checking for alphabetic keyboard here, separate keycodes for
+ // alphabetic shift and shift while in symbol layout.
+ final Keyboard currentKeyboard = mKeyboardSwitcher.getKeyboard();
+ if (null != currentKeyboard && currentKeyboard.mId.isAlphabetKeyboard()) {
+ codeToSend = codePoint;
+ } else {
+ codeToSend = Constants.CODE_SYMBOL_SHIFT;
+ }
+ } else {
+ codeToSend = codePoint;
+ }
+ mInputLogic.onCodeInput(codeToSend, keyX, keyY, mHandler, mKeyboardSwitcher,
mSubtypeSwitcher);
mKeyboardSwitcher.onCodeInput(codePoint);
}
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 3c5406545..c417ae793 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -230,20 +230,17 @@ public final class InputLogic {
LatinImeLogger.logOnDelete(x, y);
break;
case Constants.CODE_SHIFT:
- // Note: Calling back to the keyboard on Shift key is handled in
- // {@link #onPressKey(int,int,boolean)} and {@link #onReleaseKey(int,boolean)}.
- final Keyboard currentKeyboard = keyboardSwitcher.getKeyboard();
- if (null != currentKeyboard && currentKeyboard.mId.isAlphabetKeyboard()) {
- // TODO: Instead of checking for alphabetic keyboard here, separate keycodes for
- // alphabetic shift and shift while in symbol layout.
- performRecapitalization(settingsValues);
- keyboardSwitcher.updateShiftState();
- }
+ performRecapitalization(settingsValues);
+ keyboardSwitcher.updateShiftState();
break;
case Constants.CODE_CAPSLOCK:
// Note: Changing keyboard to shift lock state is handled in
// {@link KeyboardSwitcher#onCodeInput(int)}.
break;
+ case Constants.CODE_SYMBOL_SHIFT:
+ // Note: Calling back to the keyboard on the symbol Shift key is handled in
+ // {@link #onPressKey(int,int,boolean)} and {@link #onReleaseKey(int,boolean)}.
+ break;
case Constants.CODE_SWITCH_ALPHA_SYMBOL:
// Note: Calling back to the keyboard on symbol key is handled in
// {@link #onPressKey(int,int,boolean)} and {@link #onReleaseKey(int,boolean)}.