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

Bug: 3301932
Change-Id: I29b5e5a9aa8b44681e763a4d6485109f3f99f6fa
main
Tadashi G. Takaoka 2010-12-21 17:13:15 +09:00
parent c4f71668d7
commit 2b13b4f5e5
2 changed files with 9 additions and 3 deletions

View File

@ -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.

View File

@ -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;
}