Skip to content
Snippets Groups Projects
Commit 2b13b4f5 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Suppress long press timer on hinted key while temporary upper case mode

Bug: 3301932
Change-Id: I29b5e5a9aa8b44681e763a4d6485109f3f99f6fa
parent c4f71668
No related branches found
No related tags found
No related merge requests found
......@@ -144,7 +144,7 @@ public class Key {
mEdgeFlags = row.mRowEdgeFlags;
mHintIcon = null;
mManualTemporaryUpperCaseHintIcon = null;
mManualTemporaryUpperCaseCode = 0;
mManualTemporaryUpperCaseCode = Keyboard.CODE_DUMMY;
mLabelOption = 0;
mModifier = false;
mSticky = false;
......@@ -233,7 +233,7 @@ public class Key {
mLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyLabel);
mLabelOption = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelOption, 0);
mManualTemporaryUpperCaseCode = style.getInt(keyAttr,
R.styleable.Keyboard_Key_manualTemporaryUpperCaseCode, 0);
R.styleable.Keyboard_Key_manualTemporaryUpperCaseCode, Keyboard.CODE_DUMMY);
mOutputText = style.getText(keyAttr, R.styleable.Keyboard_Key_keyOutputText);
// Choose the first letter of the label as primary code if not
// specified.
......
......@@ -414,6 +414,11 @@ public class PointerTracker {
Key key = getKey(keyIndex);
if (key.mCode == Keyboard.CODE_SHIFT) {
mHandler.startLongPressShiftTimer(mLongPressShiftKeyTimeout, keyIndex, this);
} else if (key.mManualTemporaryUpperCaseCode != Keyboard.CODE_DUMMY
&& mKeyboard.isManualTemporaryUpperCase()) {
// We need not start long press timer on the key which has manual temporary upper case
// code defined and the keyboard is in manual temporary upper case mode.
return;
} else if (mKeyboardSwitcher.isInMomentaryAutoModeSwitchState()) {
// We use longer timeout for sliding finger input started from the symbols mode key.
mHandler.startLongPressTimer(mLongPressKeyTimeout * 2, keyIndex, this);
......@@ -438,7 +443,8 @@ public class PointerTracker {
// If keyboard is in manual temporary upper case state and key has manual temporary
// shift code, alternate character code should be sent.
if (mKeyboard.isManualTemporaryUpperCase() && key.mManualTemporaryUpperCaseCode != 0) {
if (mKeyboard.isManualTemporaryUpperCase()
&& key.mManualTemporaryUpperCaseCode != Keyboard.CODE_DUMMY) {
code = key.mManualTemporaryUpperCaseCode;
codes[0] = code;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment