Disable long-press on shift and symbol keys
Long-press on shift and symbol keys will conflict with press-and-hold
these keys and press normal key (a.k.a. multi touch support).
Bug: 2910379
Change-Id: I27007b55a30a3699bf63fd8f64d58c4b23d97d9f
diff --git a/java/res/xml/kbd_phone.xml b/java/res/xml/kbd_phone.xml
index d2bcdac..73d022f 100755
--- a/java/res/xml/kbd_phone.xml
+++ b/java/res/xml/kbd_phone.xml
@@ -50,8 +50,6 @@
<Row android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyIcon="@drawable/sym_keyboard_numalt"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:iconPreview="@drawable/sym_keyboard_feedback_numalt"/>
<Key android:codes="48" android:keyIcon="@drawable/sym_keyboard_num0"/>
diff --git a/java/res/xml/kbd_phone_black.xml b/java/res/xml/kbd_phone_black.xml
index b7f9096..3738f2b 100755
--- a/java/res/xml/kbd_phone_black.xml
+++ b/java/res/xml/kbd_phone_black.xml
@@ -50,8 +50,6 @@
<Row android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyIcon="@drawable/sym_bkeyboard_numalt"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:iconPreview="@drawable/sym_keyboard_feedback_numalt"/>
<Key android:codes="48" android:keyIcon="@drawable/sym_bkeyboard_num0"/>
diff --git a/java/res/xml/kbd_phone_symbols.xml b/java/res/xml/kbd_phone_symbols.xml
index 9604664..9196df8 100755
--- a/java/res/xml/kbd_phone_symbols.xml
+++ b/java/res/xml/kbd_phone_symbols.xml
@@ -55,8 +55,6 @@
<Row android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_phone_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyEdgeFlags="left"/>
<Key android:keyLabel="+"/>
<Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space"
diff --git a/java/res/xml/kbd_phone_symbols_black.xml b/java/res/xml/kbd_phone_symbols_black.xml
index c73e5fa..b996e8b 100755
--- a/java/res/xml/kbd_phone_symbols_black.xml
+++ b/java/res/xml/kbd_phone_symbols_black.xml
@@ -55,8 +55,6 @@
<Row android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_phone_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyEdgeFlags="left"/>
<Key android:keyLabel="+"/>
<Key android:codes="32" android:keyIcon="@drawable/sym_bkeyboard_space"
diff --git a/java/res/xml/kbd_qwerty.xml b/java/res/xml/kbd_qwerty.xml
index 7cb18b0..b0450c6 100755
--- a/java/res/xml/kbd_qwerty.xml
+++ b/java/res/xml/kbd_qwerty.xml
@@ -111,8 +111,6 @@
<Row android:keyboardMode="@+id/mode_normal" android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:codes="@integer/key_f1" android:keyIcon="@drawable/sym_keyboard_mic"
android:iconPreview="@drawable/sym_keyboard_feedback_mic"
@@ -129,8 +127,6 @@
<Row android:keyboardMode="@+id/mode_url" android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:keyLabel="/" android:keyWidth="10%p"/>
<Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space"
@@ -149,8 +145,6 @@
<Row android:keyboardMode="@+id/mode_email" android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:keyLabel="\@"/>
<Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space"
@@ -168,8 +162,6 @@
<Row android:keyboardMode="@+id/mode_im" android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:codes="@integer/key_f1" android:keyIcon="@drawable/sym_keyboard_mic"
android:iconPreview="@drawable/sym_keyboard_feedback_mic"
@@ -186,8 +178,6 @@
<Row android:keyboardMode="@+id/mode_webentry" android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:codes="@integer/key_f1" android:keyIcon="@drawable/sym_keyboard_mic"
android:iconPreview="@drawable/sym_keyboard_feedback_mic"
diff --git a/java/res/xml/kbd_qwerty_black.xml b/java/res/xml/kbd_qwerty_black.xml
index d013ae0..afea2f3 100755
--- a/java/res/xml/kbd_qwerty_black.xml
+++ b/java/res/xml/kbd_qwerty_black.xml
@@ -111,8 +111,6 @@
<Row android:keyboardMode="@+id/mode_normal" android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:codes="@integer/key_f1" android:keyIcon="@drawable/sym_bkeyboard_mic"
android:iconPreview="@drawable/sym_keyboard_feedback_mic"
@@ -129,8 +127,6 @@
<Row android:keyboardMode="@+id/mode_url" android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:keyLabel="/" android:keyWidth="10%p"/>
<Key android:codes="32" android:keyIcon="@drawable/sym_bkeyboard_space"
@@ -149,8 +145,6 @@
<Row android:keyboardMode="@+id/mode_email" android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:keyLabel="\@"/>
<Key android:codes="32" android:keyIcon="@drawable/sym_bkeyboard_space"
@@ -168,8 +162,6 @@
<Row android:keyboardMode="@+id/mode_im" android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:codes="@integer/key_f1" android:keyIcon="@drawable/sym_bkeyboard_mic"
android:iconPreview="@drawable/sym_keyboard_feedback_mic"
@@ -186,8 +178,6 @@
<Row android:keyboardMode="@+id/mode_webentry" android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_symbol_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:codes="@integer/key_f1" android:keyIcon="@drawable/sym_bkeyboard_mic"
android:iconPreview="@drawable/sym_keyboard_feedback_mic"
diff --git a/java/res/xml/kbd_symbols.xml b/java/res/xml/kbd_symbols.xml
index ab5792f..77eb7d0 100755
--- a/java/res/xml/kbd_symbols.xml
+++ b/java/res/xml/kbd_symbols.xml
@@ -123,8 +123,6 @@
<Row android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_alpha_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:codes="@integer/key_f1" android:keyWidth="10%p"/>
<Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space"
diff --git a/java/res/xml/kbd_symbols_black.xml b/java/res/xml/kbd_symbols_black.xml
index 5652f7f..5f8dfbe 100755
--- a/java/res/xml/kbd_symbols_black.xml
+++ b/java/res/xml/kbd_symbols_black.xml
@@ -123,8 +123,6 @@
<Row android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_alpha_key"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:codes="@integer/key_f1" android:keyWidth="10%p"/>
<Key android:codes="32" android:keyIcon="@drawable/sym_bkeyboard_space"
diff --git a/java/res/xml/kbd_symbols_shift.xml b/java/res/xml/kbd_symbols_shift.xml
index ca431fc..467ca52 100755
--- a/java/res/xml/kbd_symbols_shift.xml
+++ b/java/res/xml/kbd_symbols_shift.xml
@@ -90,8 +90,6 @@
<Row android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_alpha_key" android:keyWidth="20%p"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyEdgeFlags="left"/>
<Key android:keyLabel="„" android:keyWidth="10%p" />
<Key android:codes="32" android:keyIcon="@drawable/sym_keyboard_space"
diff --git a/java/res/xml/kbd_symbols_shift_black.xml b/java/res/xml/kbd_symbols_shift_black.xml
index a8acb9d..511ad49 100755
--- a/java/res/xml/kbd_symbols_shift_black.xml
+++ b/java/res/xml/kbd_symbols_shift_black.xml
@@ -90,8 +90,6 @@
<Row android:rowEdgeFlags="bottom">
<Key android:codes="-2" android:keyLabel="@string/label_alpha_key" android:keyWidth="20%p"
- android:popupKeyboard="@xml/kbd_popup_template"
- android:popupCharacters="_"
android:keyEdgeFlags="left"/>
<Key android:keyLabel="„" android:keyWidth="10%p" />
<Key android:codes="32" android:keyIcon="@drawable/sym_bkeyboard_space"
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 2753bb8..37ae43d 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1103,9 +1103,6 @@
case LatinKeyboardView.KEYCODE_PREV_LANGUAGE:
toggleLanguage(false, false);
break;
- case LatinKeyboardView.KEYCODE_SHIFT_LONGPRESS:
- handleCapsLock();
- break;
case Keyboard.KEYCODE_MODE_CHANGE:
changeKeyboardMode();
break;
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
index e57abd2..cca0de1 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
@@ -34,7 +34,6 @@
public class LatinKeyboardView extends LatinKeyboardBaseView {
static final int KEYCODE_OPTIONS = -100;
- 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;
@@ -95,18 +94,7 @@
@Override
protected boolean onLongPress(Key key) {
- if (key.codes[0] == Keyboard.KEYCODE_MODE_CHANGE) {
- getOnKeyboardActionListener().onKey(KEYCODE_OPTIONS, null,
- LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE,
- LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE);
- return true;
- } else if (key.codes[0] == Keyboard.KEYCODE_SHIFT) {
- getOnKeyboardActionListener().onKey(KEYCODE_SHIFT_LONGPRESS, null,
- LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE,
- LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE);
- invalidateAllKeys();
- return true;
- } else if (key.codes[0] == '0' && getKeyboard() == mPhoneKeyboard) {
+ if (key.codes[0] == '0' && getKeyboard() == mPhoneKeyboard) {
// Long pressing on 0 in phone number keypad gives you a '+'.
getOnKeyboardActionListener().onKey(
'+', null, LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE,