Fix snap back behavior for a quote mark input.

Follow-up for I8168ce6a

Change-Id: I63b04471c90d3d02de1bb8f092b5d57614cd8591
main
Ken Wakasa 2011-04-27 19:10:32 +09:00
parent 19bfef6cb0
commit 0b4757604d
1 changed files with 5 additions and 1 deletions

View File

@ -698,11 +698,15 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
if (!isSpaceCharacter(code) && code >= 0) { if (!isSpaceCharacter(code) && code >= 0) {
mSwitchState = SWITCH_STATE_SYMBOL; mSwitchState = SWITCH_STATE_SYMBOL;
} }
// Snap back to alpha keyboard mode immediately if user types a quote character.
if (isQuoteCharacter(code)) {
changeKeyboardMode();
}
break; break;
case SWITCH_STATE_SYMBOL: case SWITCH_STATE_SYMBOL:
case SWITCH_STATE_CHORDING_SYMBOL: case SWITCH_STATE_CHORDING_SYMBOL:
// Snap back to alpha keyboard mode if user types one or more non-space/enter // Snap back to alpha keyboard mode if user types one or more non-space/enter
// characters followed by a space/enter or quotation mark. // characters followed by a space/enter or a quote character.
if (isSpaceCharacter(code) || isQuoteCharacter(code)) { if (isSpaceCharacter(code) || isQuoteCharacter(code)) {
changeKeyboardMode(); changeKeyboardMode();
} }