aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-01-19 18:53:38 +0900
committerTadashi G. Takaoka <takaoka@google.com>2012-01-19 18:53:38 +0900
commitf36f90a1730f8e2838ffc72135f79f5190b83a43 (patch)
treefb02c29e0e6e69e055416a0c06d891b8978d1d0b /java/src
parentd26d63b35d34333a8f6737572b1c306b774eebd0 (diff)
downloadlatinime-f36f90a1730f8e2838ffc72135f79f5190b83a43.tar.gz
latinime-f36f90a1730f8e2838ffc72135f79f5190b83a43.tar.xz
latinime-f36f90a1730f8e2838ffc72135f79f5190b83a43.zip
Fix KeyboardState switching back from alphabet-chording input correctly
Bug: 5881820 Change-Id: I108bbc25baa331cc87f00955b48188b3557d10dd
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
index 54b1c1f09..af16e4907 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
@@ -78,6 +78,7 @@ public class KeyboardState {
private KeyboardShiftState mAlphabetShiftState = new KeyboardShiftState();
private boolean mIsSymbolShifted;
private boolean mPrevMainKeyboardWasShiftLocked;
+ private boolean mPrevSymbolsKeyboardWasShifted;
private final SavedKeyboardState mSavedKeyboardState = new SavedKeyboardState();
@@ -100,6 +101,7 @@ public class KeyboardState {
// Reset alphabet shift state.
mAlphabetShiftState.setShiftLocked(false);
mPrevMainKeyboardWasShiftLocked = false;
+ mPrevSymbolsKeyboardWasShifted = false;
mShiftKeyState.onRelease();
mSymbolKeyState.onRelease();
onRestoreKeyboardState();
@@ -202,6 +204,7 @@ public class KeyboardState {
if (DEBUG_ACTION) {
Log.d(TAG, "setAlphabetKeyboard");
}
+ mPrevSymbolsKeyboardWasShifted = mIsSymbolShifted;
mSwitchActions.setAlphabetKeyboard();
mIsAlphabetMode = true;
mIsSymbolShifted = false;
@@ -214,6 +217,11 @@ public class KeyboardState {
// TODO: Make this method private
public void setSymbolsKeyboard() {
mPrevMainKeyboardWasShiftLocked = mAlphabetShiftState.isShiftLocked();
+ if (mPrevSymbolsKeyboardWasShifted) {
+ setSymbolsShiftedKeyboard();
+ return;
+ }
+
if (DEBUG_ACTION) {
Log.d(TAG, "setSymbolsKeyboard");
}
@@ -222,6 +230,7 @@ public class KeyboardState {
mIsSymbolShifted = false;
// Reset alphabet shift state.
mAlphabetShiftState.setShiftLocked(false);
+ mPrevSymbolsKeyboardWasShifted = false;
mSwitchState = SWITCH_STATE_SYMBOL_BEGIN;
}
@@ -234,6 +243,7 @@ public class KeyboardState {
mIsSymbolShifted = true;
// Reset alphabet shift state.
mAlphabetShiftState.setShiftLocked(false);
+ mPrevSymbolsKeyboardWasShifted = false;
mSwitchState = SWITCH_STATE_SYMBOL_BEGIN;
}