aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
index 4af4e3cdf..38837f519 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
@@ -80,14 +80,14 @@ public class KeyboardState {
static class SavedKeyboardState {
public boolean mIsValid;
public boolean mIsAlphabetMode;
- public boolean mIsShiftLocked;
+ public boolean mIsAlphabetShiftLocked;
public boolean mIsShifted;
@Override
public String toString() {
if (!mIsValid) return "INVALID";
if (mIsAlphabetMode) {
- if (mIsShiftLocked) return "ALPHABET_SHIFT_LOCKED";
+ if (mIsAlphabetShiftLocked) return "ALPHABET_SHIFT_LOCKED";
return mIsShifted ? "ALPHABET_SHIFTED" : "ALPHABET";
} else {
return mIsShifted ? "SYMBOLS_SHIFTED" : "SYMBOLS";
@@ -117,11 +117,11 @@ public class KeyboardState {
final SavedKeyboardState state = mSavedKeyboardState;
state.mIsAlphabetMode = mIsAlphabetMode;
if (mIsAlphabetMode) {
- state.mIsShiftLocked = mAlphabetShiftState.isShiftLocked();
- state.mIsShifted = !state.mIsShiftLocked
+ state.mIsAlphabetShiftLocked = mAlphabetShiftState.isShiftLocked();
+ state.mIsShifted = !state.mIsAlphabetShiftLocked
&& mAlphabetShiftState.isShiftedOrShiftLocked();
} else {
- state.mIsShiftLocked = false;
+ state.mIsAlphabetShiftLocked = mPrevMainKeyboardWasShiftLocked;
state.mIsShifted = mIsSymbolShifted;
}
state.mIsValid = true;
@@ -149,10 +149,12 @@ public class KeyboardState {
state.mIsValid = false;
if (state.mIsAlphabetMode) {
- setShiftLocked(state.mIsShiftLocked);
- if (!state.mIsShiftLocked) {
+ setShiftLocked(state.mIsAlphabetShiftLocked);
+ if (!state.mIsAlphabetShiftLocked) {
setShifted(state.mIsShifted ? MANUAL_SHIFT : UNSHIFT);
}
+ } else {
+ mPrevMainKeyboardWasShiftLocked = state.mIsAlphabetShiftLocked;
}
}