Reset previous symbols shifted state when auto switch backed

Bug: 6072517
Change-Id: I00337b3ed5c85df4627e8f5a02465d406c4d9178
main
Tadashi G. Takaoka 2012-02-27 12:56:08 +09:00
parent 5a0661eae8
commit 4ba2216219
2 changed files with 7 additions and 2 deletions

View File

@ -546,16 +546,19 @@ public class KeyboardState {
|| code == Keyboard.CODE_OUTPUT_TEXT)) {
mSwitchState = SWITCH_STATE_SYMBOL;
}
// Switch back to alpha keyboard mode immediately if user types a quote character.
// Switch back to alpha keyboard mode immediately if user types one of the switch back
// characters.
if (isLayoutSwitchBackCharacter(code)) {
toggleAlphabetAndSymbols();
mPrevSymbolsKeyboardWasShifted = false;
}
break;
case SWITCH_STATE_SYMBOL:
// Switch back to alpha keyboard mode if user types one or more non-space/enter
// characters followed by a space/enter or a quote character.
// characters followed by a space/enter or one of the switch back characters.
if (isSpaceCharacter(code) || isLayoutSwitchBackCharacter(code)) {
toggleAlphabetAndSymbols();
mPrevSymbolsKeyboardWasShifted = false;
}
break;
}

View File

@ -122,6 +122,8 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
pressAndReleaseKey('~', SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
// Enter space, switch back to alphabet.
pressAndReleaseKey(CODE_SPACE, SYMBOLS_SHIFTED, ALPHABET_UNSHIFTED);
// Press/release "?123" key, enter into symbols (not symbols shifted).
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
}
// Automatic switch back to alphabet shift locked test by space key.