aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/android/inputmethod/latin/KeyboardSwitcher.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2009-07-28 16:33:36 -0700
committerJean-Baptiste Queru <jbq@google.com>2009-08-13 17:27:12 -0700
commitd67fe0e7583f1be18b35b33b7658e4427f1e3ded (patch)
treeb09382427b141d86b17d722dddac31dc221fa68e /src/com/android/inputmethod/latin/KeyboardSwitcher.java
parent4a7ff90d513f8b6cbf39688c08be0828a57e311b (diff)
downloadlatinime-d67fe0e7583f1be18b35b33b7658e4427f1e3ded.tar.gz
latinime-d67fe0e7583f1be18b35b33b7658e4427f1e3ded.tar.xz
latinime-d67fe0e7583f1be18b35b33b7658e4427f1e3ded.zip
Improve auto-add heuristics.
Also add auto-switch back to alphabet mode on pressing enter key.
Diffstat (limited to 'src/com/android/inputmethod/latin/KeyboardSwitcher.java')
-rw-r--r--src/com/android/inputmethod/latin/KeyboardSwitcher.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/src/com/android/inputmethod/latin/KeyboardSwitcher.java
index a5aebfbfe..16dd7b9a7 100644
--- a/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+++ b/src/com/android/inputmethod/latin/KeyboardSwitcher.java
@@ -245,14 +245,16 @@ public class KeyboardSwitcher {
* Returns true if the keyboard needs to switch back
*/
boolean onKey(int key) {
- // Switch back to alpha mode if user types one or more non-space characters followed by
- // a space.
+ // Switch back to alpha mode if user types one or more non-space/enter characters
+ // followed by a space/enter
switch (mSymbolsModeState) {
case SYMBOLS_MODE_STATE_BEGIN:
- if (key != ' ' && key > 0) mSymbolsModeState = SYMBOLS_MODE_STATE_SYMBOL;
+ if (key != LatinIME.KEYCODE_SPACE && key != LatinIME.KEYCODE_ENTER && key > 0) {
+ mSymbolsModeState = SYMBOLS_MODE_STATE_SYMBOL;
+ }
break;
case SYMBOLS_MODE_STATE_SYMBOL:
- if (key == ' ') return true;
+ if (key == LatinIME.KEYCODE_ENTER || key == LatinIME.KEYCODE_SPACE) return true;
break;
}
return false;