From 747ed9e99a6a83e54d97d96aa3cbb1abd11eaf0f Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 24 Jan 2012 14:47:46 +0900 Subject: For get the symbols shifted state when switch back from alphabet layout Bug: 5881820 Change-Id: Ic478264e1cd366affc34fbf4cd59f1b6e7efede7 --- .../inputmethod/keyboard/internal/KeyboardState.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'java/src') diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index 007b10112..f89f156ea 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -302,8 +302,7 @@ public class KeyboardState { if (code == Keyboard.CODE_SHIFT) { onReleaseShift(withSliding); } else if (code == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) { - // TODO: Make use of withSliding instead of relying on mSwitchState. - onReleaseSymbol(); + onReleaseSymbol(withSliding); } } @@ -313,11 +312,16 @@ public class KeyboardState { mSwitchState = SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL; } - private void onReleaseSymbol() { - // Switch back to the previous keyboard mode if the user chords the mode change key and - // another key, then releases the mode change key. + private void onReleaseSymbol(boolean withSliding) { if (mSwitchState == SWITCH_STATE_CHORDING_ALPHA) { + // Switch back to the previous keyboard mode if the user chords the mode change key and + // another key, then releases the mode change key. toggleAlphabetAndSymbols(); + } else if (!withSliding) { + // If the mode change key is being released without sliding, we should forget the + // previous symbols keyboard shift state and simply switch back to symbols layout + // (never symbols shifted) next time the mode gets changed to symbols layout. + mPrevSymbolsKeyboardWasShifted = false; } mSymbolKeyState.onRelease(); } -- cgit v1.2.3-83-g751a