Merge "Suppress long press timer on hinted key while temporary upper case mode"
commit
6311acb7f4
|
@ -144,7 +144,7 @@ public class Key {
|
||||||
mEdgeFlags = row.mRowEdgeFlags;
|
mEdgeFlags = row.mRowEdgeFlags;
|
||||||
mHintIcon = null;
|
mHintIcon = null;
|
||||||
mManualTemporaryUpperCaseHintIcon = null;
|
mManualTemporaryUpperCaseHintIcon = null;
|
||||||
mManualTemporaryUpperCaseCode = 0;
|
mManualTemporaryUpperCaseCode = Keyboard.CODE_DUMMY;
|
||||||
mLabelOption = 0;
|
mLabelOption = 0;
|
||||||
mModifier = false;
|
mModifier = false;
|
||||||
mSticky = false;
|
mSticky = false;
|
||||||
|
@ -233,7 +233,7 @@ public class Key {
|
||||||
mLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyLabel);
|
mLabel = style.getText(keyAttr, R.styleable.Keyboard_Key_keyLabel);
|
||||||
mLabelOption = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelOption, 0);
|
mLabelOption = style.getFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelOption, 0);
|
||||||
mManualTemporaryUpperCaseCode = style.getInt(keyAttr,
|
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);
|
mOutputText = style.getText(keyAttr, R.styleable.Keyboard_Key_keyOutputText);
|
||||||
// Choose the first letter of the label as primary code if not
|
// Choose the first letter of the label as primary code if not
|
||||||
// specified.
|
// specified.
|
||||||
|
|
|
@ -414,6 +414,11 @@ public class PointerTracker {
|
||||||
Key key = getKey(keyIndex);
|
Key key = getKey(keyIndex);
|
||||||
if (key.mCode == Keyboard.CODE_SHIFT) {
|
if (key.mCode == Keyboard.CODE_SHIFT) {
|
||||||
mHandler.startLongPressShiftTimer(mLongPressShiftKeyTimeout, keyIndex, this);
|
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()) {
|
} else if (mKeyboardSwitcher.isInMomentaryAutoModeSwitchState()) {
|
||||||
// We use longer timeout for sliding finger input started from the symbols mode key.
|
// We use longer timeout for sliding finger input started from the symbols mode key.
|
||||||
mHandler.startLongPressTimer(mLongPressKeyTimeout * 2, keyIndex, this);
|
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
|
// If keyboard is in manual temporary upper case state and key has manual temporary
|
||||||
// shift code, alternate character code should be sent.
|
// 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;
|
code = key.mManualTemporaryUpperCaseCode;
|
||||||
codes[0] = code;
|
codes[0] = code;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue