diff options
author | 2010-01-22 13:57:20 -0800 | |
---|---|---|
committer | 2010-01-22 13:57:20 -0800 | |
commit | 8eb2e34d5b2def57c9548f88e37e5c9e5a0bea59 (patch) | |
tree | 88a543c7d8b7a4ee9648eb0d0f42bc6e84362053 /src/com/android/inputmethod/latin/LatinKeyboardView.java | |
parent | 578a01d3f60d27f76f592c82d4c377a06f9a6efd (diff) | |
download | latinime-8eb2e34d5b2def57c9548f88e37e5c9e5a0bea59.tar.gz latinime-8eb2e34d5b2def57c9548f88e37e5c9e5a0bea59.tar.xz latinime-8eb2e34d5b2def57c9548f88e37e5c9e5a0bea59.zip |
Enable language switching with long-press of space bar.
This is a temporary solution until slide-on-space is implemented.
Diffstat (limited to 'src/com/android/inputmethod/latin/LatinKeyboardView.java')
-rw-r--r-- | src/com/android/inputmethod/latin/LatinKeyboardView.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/inputmethod/latin/LatinKeyboardView.java b/src/com/android/inputmethod/latin/LatinKeyboardView.java index ea9ccf0b6..a88c1818c 100644 --- a/src/com/android/inputmethod/latin/LatinKeyboardView.java +++ b/src/com/android/inputmethod/latin/LatinKeyboardView.java @@ -37,6 +37,8 @@ public class LatinKeyboardView extends KeyboardView { static final int KEYCODE_SHIFT_LONGPRESS = -101; static final int KEYCODE_VOICE = -102; static final int KEYCODE_F1 = -103; + static final int KEYCODE_NEXT_LANGUAGE = -104; + private Keyboard mPhoneKeyboard; public LatinKeyboardView(Context context, AttributeSet attrs) { @@ -64,6 +66,9 @@ public class LatinKeyboardView extends KeyboardView { // Long pressing on 0 in phone number keypad gives you a '+'. getOnKeyboardActionListener().onKey('+', null); return true; + } else if (key.codes[0] == ' ' && ((LatinKeyboard)getKeyboard()).mLocale != null) { + getOnKeyboardActionListener().onKey(KEYCODE_NEXT_LANGUAGE, null); + return true; } else { return super.onLongPress(key); } |