Merge "Remove symbols shifted layout related code"
commit
ce607358bd
|
@ -370,7 +370,6 @@
|
||||||
<enum name="alphabetShiftLocked" value="3" />
|
<enum name="alphabetShiftLocked" value="3" />
|
||||||
<enum name="alphabetShiftLockShifted" value="4" />
|
<enum name="alphabetShiftLockShifted" value="4" />
|
||||||
<enum name="symbols" value="5" />
|
<enum name="symbols" value="5" />
|
||||||
<enum name="symbolsShifted" value="6" />
|
|
||||||
<enum name="phone" value="7" />
|
<enum name="phone" value="7" />
|
||||||
<enum name="phoneSymbols" value="8" />
|
<enum name="phoneSymbols" value="8" />
|
||||||
<enum name="number" value="9" />
|
<enum name="number" value="9" />
|
||||||
|
@ -425,7 +424,6 @@
|
||||||
<enum name="alphabetShiftLocked" value="3" />
|
<enum name="alphabetShiftLocked" value="3" />
|
||||||
<enum name="alphabetShiftLockShifted" value="4" />
|
<enum name="alphabetShiftLockShifted" value="4" />
|
||||||
<enum name="symbols" value="5" />
|
<enum name="symbols" value="5" />
|
||||||
<enum name="symbolsShifted" value="6" />
|
|
||||||
<enum name="phone" value="7" />
|
<enum name="phone" value="7" />
|
||||||
<enum name="phoneSymbols" value="8" />
|
<enum name="phoneSymbols" value="8" />
|
||||||
<enum name="number" value="9" />
|
<enum name="number" value="9" />
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
>
|
>
|
||||||
<switch>
|
<switch>
|
||||||
<case
|
<case
|
||||||
latin:keyboardLayoutSetElement="symbols|symbolsShifted"
|
latin:keyboardLayoutSetElement="symbols"
|
||||||
>
|
>
|
||||||
<Key
|
<Key
|
||||||
latin:keyLabel="["
|
latin:keyLabel="["
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
>
|
>
|
||||||
<switch>
|
<switch>
|
||||||
<case
|
<case
|
||||||
latin:keyboardLayoutSetElement="symbols|symbolsShifted"
|
latin:keyboardLayoutSetElement="symbols"
|
||||||
>
|
>
|
||||||
<Key
|
<Key
|
||||||
latin:keyLabel=";"
|
latin:keyLabel=";"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
>
|
>
|
||||||
<switch>
|
<switch>
|
||||||
<case
|
<case
|
||||||
latin:keyboardLayoutSetElement="symbols|symbolsShifted"
|
latin:keyboardLayoutSetElement="symbols"
|
||||||
>
|
>
|
||||||
<!-- U+2039: "‹" SINGLE LEFT-POINTING ANGLE QUOTATION MARK
|
<!-- U+2039: "‹" SINGLE LEFT-POINTING ANGLE QUOTATION MARK
|
||||||
U+203A: "›" SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
|
U+203A: "›" SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
>
|
>
|
||||||
<switch>
|
<switch>
|
||||||
<case
|
<case
|
||||||
latin:keyboardLayoutSetElement="symbols|symbolsShifted"
|
latin:keyboardLayoutSetElement="symbols"
|
||||||
>
|
>
|
||||||
<include
|
<include
|
||||||
latin:keyboardLayout="@xml/keys_pcqwerty_symbols1" />
|
latin:keyboardLayout="@xml/keys_pcqwerty_symbols1" />
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
latin:keyboardLayout="@xml/key_settings" />
|
latin:keyboardLayout="@xml/key_settings" />
|
||||||
<switch>
|
<switch>
|
||||||
<case
|
<case
|
||||||
latin:keyboardLayoutSetElement="symbols|symbolsShifted"
|
latin:keyboardLayoutSetElement="symbols"
|
||||||
>
|
>
|
||||||
<Spacer
|
<Spacer
|
||||||
latin:keyXPos="15.0%p"
|
latin:keyXPos="15.0%p"
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
>
|
>
|
||||||
<switch>
|
<switch>
|
||||||
<case
|
<case
|
||||||
latin:keyboardLayoutSetElement="symbols|symbolsShifted"
|
latin:keyboardLayoutSetElement="symbols"
|
||||||
>
|
>
|
||||||
<Key
|
<Key
|
||||||
latin:keyStyle="toAlphaKeyStyle"
|
latin:keyStyle="toAlphaKeyStyle"
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
latin:keyLabel="="
|
latin:keyLabel="="
|
||||||
latin:moreKeys="+" />
|
latin:moreKeys="+" />
|
||||||
</case>
|
</case>
|
||||||
<!-- keyboardLayoutSetElement="alphabet*Shifted|symbols*" -->
|
<!-- keyboardLayoutSetElement="alphabet*Shifted|symbols" -->
|
||||||
<default>
|
<default>
|
||||||
<include
|
<include
|
||||||
latin:keyboardLayout="@xml/keys_pcqwerty_symbols1" />
|
latin:keyboardLayout="@xml/keys_pcqwerty_symbols1" />
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
>
|
>
|
||||||
<switch>
|
<switch>
|
||||||
<case
|
<case
|
||||||
latin:keyboardLayoutSetElement="symbols|symbolsShifted"
|
latin:keyboardLayoutSetElement="symbols"
|
||||||
>
|
>
|
||||||
<include
|
<include
|
||||||
latin:keyboardLayout="@xml/keys_pcqwerty_symbols2" />
|
latin:keyboardLayout="@xml/keys_pcqwerty_symbols2" />
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
>
|
>
|
||||||
<switch>
|
<switch>
|
||||||
<case
|
<case
|
||||||
latin:keyboardLayoutSetElement="symbols|symbolsShifted"
|
latin:keyboardLayoutSetElement="symbols"
|
||||||
>
|
>
|
||||||
<include
|
<include
|
||||||
latin:keyboardLayout="@xml/keys_pcqwerty_symbols3" />
|
latin:keyboardLayout="@xml/keys_pcqwerty_symbols3" />
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
>
|
>
|
||||||
<switch>
|
<switch>
|
||||||
<case
|
<case
|
||||||
latin:keyboardLayoutSetElement="symbols|symbolsShifted"
|
latin:keyboardLayoutSetElement="symbols"
|
||||||
>
|
>
|
||||||
<include
|
<include
|
||||||
latin:keyboardLayout="@xml/keys_pcqwerty_symbols4" />
|
latin:keyboardLayout="@xml/keys_pcqwerty_symbols4" />
|
||||||
|
|
|
@ -357,7 +357,6 @@ public final class AccessibleKeyboardViewProxy extends AccessibilityDelegateComp
|
||||||
break;
|
break;
|
||||||
case KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED:
|
case KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED:
|
||||||
case KeyboardId.ELEMENT_ALPHABET_MANUAL_SHIFTED:
|
case KeyboardId.ELEMENT_ALPHABET_MANUAL_SHIFTED:
|
||||||
case KeyboardId.ELEMENT_SYMBOLS_SHIFTED:
|
|
||||||
text = context.getText(R.string.spoken_description_shiftmode_on);
|
text = context.getText(R.string.spoken_description_shiftmode_on);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -389,7 +388,6 @@ public final class AccessibleKeyboardViewProxy extends AccessibilityDelegateComp
|
||||||
resId = R.string.spoken_description_mode_alpha;
|
resId = R.string.spoken_description_mode_alpha;
|
||||||
break;
|
break;
|
||||||
case KeyboardId.ELEMENT_SYMBOLS:
|
case KeyboardId.ELEMENT_SYMBOLS:
|
||||||
case KeyboardId.ELEMENT_SYMBOLS_SHIFTED:
|
|
||||||
resId = R.string.spoken_description_mode_symbol;
|
resId = R.string.spoken_description_mode_symbol;
|
||||||
break;
|
break;
|
||||||
case KeyboardId.ELEMENT_PHONE:
|
case KeyboardId.ELEMENT_PHONE:
|
||||||
|
|
|
@ -156,7 +156,6 @@ public final class KeyCodeDescriptionMapper {
|
||||||
resId = R.string.spoken_description_to_symbol;
|
resId = R.string.spoken_description_to_symbol;
|
||||||
break;
|
break;
|
||||||
case KeyboardId.ELEMENT_SYMBOLS:
|
case KeyboardId.ELEMENT_SYMBOLS:
|
||||||
case KeyboardId.ELEMENT_SYMBOLS_SHIFTED:
|
|
||||||
resId = R.string.spoken_description_to_alpha;
|
resId = R.string.spoken_description_to_alpha;
|
||||||
break;
|
break;
|
||||||
case KeyboardId.ELEMENT_PHONE:
|
case KeyboardId.ELEMENT_PHONE:
|
||||||
|
@ -191,7 +190,6 @@ public final class KeyCodeDescriptionMapper {
|
||||||
break;
|
break;
|
||||||
case KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED:
|
case KeyboardId.ELEMENT_ALPHABET_AUTOMATIC_SHIFTED:
|
||||||
case KeyboardId.ELEMENT_ALPHABET_MANUAL_SHIFTED:
|
case KeyboardId.ELEMENT_ALPHABET_MANUAL_SHIFTED:
|
||||||
case KeyboardId.ELEMENT_SYMBOLS_SHIFTED:
|
|
||||||
resId = R.string.spoken_description_shift_shifted;
|
resId = R.string.spoken_description_shift_shifted;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -50,8 +50,6 @@ public final class KeyboardId {
|
||||||
public static final int ELEMENT_ALPHABET_SHIFT_LOCKED = 3;
|
public static final int ELEMENT_ALPHABET_SHIFT_LOCKED = 3;
|
||||||
public static final int ELEMENT_ALPHABET_SHIFT_LOCK_SHIFTED = 4;
|
public static final int ELEMENT_ALPHABET_SHIFT_LOCK_SHIFTED = 4;
|
||||||
public static final int ELEMENT_SYMBOLS = 5;
|
public static final int ELEMENT_SYMBOLS = 5;
|
||||||
// TODO: Remove this constant and related stuff.
|
|
||||||
public static final int ELEMENT_SYMBOLS_SHIFTED = 6;
|
|
||||||
public static final int ELEMENT_PHONE = 7;
|
public static final int ELEMENT_PHONE = 7;
|
||||||
public static final int ELEMENT_PHONE_SYMBOLS = 8;
|
public static final int ELEMENT_PHONE_SYMBOLS = 8;
|
||||||
public static final int ELEMENT_NUMBER = 9;
|
public static final int ELEMENT_NUMBER = 9;
|
||||||
|
@ -214,7 +212,6 @@ public final class KeyboardId {
|
||||||
case ELEMENT_ALPHABET_SHIFT_LOCKED: return "alphabetShiftLocked";
|
case ELEMENT_ALPHABET_SHIFT_LOCKED: return "alphabetShiftLocked";
|
||||||
case ELEMENT_ALPHABET_SHIFT_LOCK_SHIFTED: return "alphabetShiftLockShifted";
|
case ELEMENT_ALPHABET_SHIFT_LOCK_SHIFTED: return "alphabetShiftLockShifted";
|
||||||
case ELEMENT_SYMBOLS: return "symbols";
|
case ELEMENT_SYMBOLS: return "symbols";
|
||||||
case ELEMENT_SYMBOLS_SHIFTED: return "symbolsShifted";
|
|
||||||
case ELEMENT_PHONE: return "phone";
|
case ELEMENT_PHONE: return "phone";
|
||||||
case ELEMENT_PHONE_SYMBOLS: return "phoneSymbols";
|
case ELEMENT_PHONE_SYMBOLS: return "phoneSymbols";
|
||||||
case ELEMENT_NUMBER: return "number";
|
case ELEMENT_NUMBER: return "number";
|
||||||
|
|
|
@ -256,12 +256,6 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
setKeyboard(mKeyboardLayoutSet.getKeyboard(KeyboardId.ELEMENT_SYMBOLS));
|
setKeyboard(mKeyboardLayoutSet.getKeyboard(KeyboardId.ELEMENT_SYMBOLS));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implements {@link KeyboardState.SwitchActions}.
|
|
||||||
@Override
|
|
||||||
public void setSymbolsShiftedKeyboard() {
|
|
||||||
setKeyboard(mKeyboardLayoutSet.getKeyboard(KeyboardId.ELEMENT_SYMBOLS_SHIFTED));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Implements {@link KeyboardState.SwitchActions}.
|
// Implements {@link KeyboardState.SwitchActions}.
|
||||||
@Override
|
@Override
|
||||||
public void requestUpdatingShiftState() {
|
public void requestUpdatingShiftState() {
|
||||||
|
|
|
@ -46,8 +46,6 @@ public final class KeyboardState {
|
||||||
public void setAlphabetShiftLockedKeyboard();
|
public void setAlphabetShiftLockedKeyboard();
|
||||||
public void setAlphabetShiftLockShiftedKeyboard();
|
public void setAlphabetShiftLockShiftedKeyboard();
|
||||||
public void setSymbolsKeyboard();
|
public void setSymbolsKeyboard();
|
||||||
// TODO: Remove this method and related stuff.
|
|
||||||
public void setSymbolsShiftedKeyboard();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request to call back {@link KeyboardState#onUpdateShiftState(int, int)}.
|
* Request to call back {@link KeyboardState#onUpdateShiftState(int, int)}.
|
||||||
|
@ -65,22 +63,17 @@ public final class KeyboardState {
|
||||||
private ModifierKeyState mSymbolKeyState = new ModifierKeyState("Symbol");
|
private ModifierKeyState mSymbolKeyState = new ModifierKeyState("Symbol");
|
||||||
|
|
||||||
// TODO: Merge {@link #mSwitchState}, {@link #mIsAlphabetMode}, {@link #mAlphabetShiftState},
|
// TODO: Merge {@link #mSwitchState}, {@link #mIsAlphabetMode}, {@link #mAlphabetShiftState},
|
||||||
// {@link #mIsSymbolShifted}, {@link #mPrevMainKeyboardWasShiftLocked}, and
|
// {@link #mPrevMainKeyboardWasShiftLocked} into single state variable.
|
||||||
// {@link #mPrevSymbolsKeyboardWasShifted} into single state variable.
|
|
||||||
private static final int SWITCH_STATE_ALPHA = 0;
|
private static final int SWITCH_STATE_ALPHA = 0;
|
||||||
private static final int SWITCH_STATE_SYMBOL_BEGIN = 1;
|
private static final int SWITCH_STATE_SYMBOL_BEGIN = 1;
|
||||||
private static final int SWITCH_STATE_SYMBOL = 2;
|
private static final int SWITCH_STATE_SYMBOL = 2;
|
||||||
private static final int SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL = 3;
|
private static final int SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL = 3;
|
||||||
// TODO: Remove this constant and related stuff.
|
|
||||||
private static final int SWITCH_STATE_MOMENTARY_SYMBOL_AND_MORE = 4;
|
|
||||||
private static final int SWITCH_STATE_MOMENTARY_ALPHA_SHIFT = 5;
|
private static final int SWITCH_STATE_MOMENTARY_ALPHA_SHIFT = 5;
|
||||||
private int mSwitchState = SWITCH_STATE_ALPHA;
|
private int mSwitchState = SWITCH_STATE_ALPHA;
|
||||||
|
|
||||||
private boolean mIsAlphabetMode;
|
private boolean mIsAlphabetMode;
|
||||||
private AlphabetShiftState mAlphabetShiftState = new AlphabetShiftState();
|
private AlphabetShiftState mAlphabetShiftState = new AlphabetShiftState();
|
||||||
private boolean mIsSymbolShifted;
|
|
||||||
private boolean mPrevMainKeyboardWasShiftLocked;
|
private boolean mPrevMainKeyboardWasShiftLocked;
|
||||||
private boolean mPrevSymbolsKeyboardWasShifted;
|
|
||||||
private int mRecapitalizeMode;
|
private int mRecapitalizeMode;
|
||||||
|
|
||||||
// For handling double tap.
|
// For handling double tap.
|
||||||
|
@ -102,7 +95,7 @@ public final class KeyboardState {
|
||||||
if (mIsAlphabetShiftLocked) return "ALPHABET_SHIFT_LOCKED";
|
if (mIsAlphabetShiftLocked) return "ALPHABET_SHIFT_LOCKED";
|
||||||
return "ALPHABET_" + shiftModeToString(mShiftMode);
|
return "ALPHABET_" + shiftModeToString(mShiftMode);
|
||||||
} else {
|
} else {
|
||||||
return "SYMBOLS_" + shiftModeToString(mShiftMode);
|
return "SYMBOLS";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,7 +112,6 @@ public final class KeyboardState {
|
||||||
// Reset alphabet shift state.
|
// Reset alphabet shift state.
|
||||||
mAlphabetShiftState.setShiftLocked(false);
|
mAlphabetShiftState.setShiftLocked(false);
|
||||||
mPrevMainKeyboardWasShiftLocked = false;
|
mPrevMainKeyboardWasShiftLocked = false;
|
||||||
mPrevSymbolsKeyboardWasShifted = false;
|
|
||||||
mShiftKeyState.onRelease();
|
mShiftKeyState.onRelease();
|
||||||
mSymbolKeyState.onRelease();
|
mSymbolKeyState.onRelease();
|
||||||
onRestoreKeyboardState();
|
onRestoreKeyboardState();
|
||||||
|
@ -139,7 +131,6 @@ public final class KeyboardState {
|
||||||
: (mAlphabetShiftState.isShiftedOrShiftLocked() ? MANUAL_SHIFT : UNSHIFT);
|
: (mAlphabetShiftState.isShiftedOrShiftLocked() ? MANUAL_SHIFT : UNSHIFT);
|
||||||
} else {
|
} else {
|
||||||
state.mIsAlphabetShiftLocked = mPrevMainKeyboardWasShiftLocked;
|
state.mIsAlphabetShiftLocked = mPrevMainKeyboardWasShiftLocked;
|
||||||
state.mShiftMode = mIsSymbolShifted ? MANUAL_SHIFT : UNSHIFT;
|
|
||||||
}
|
}
|
||||||
state.mIsValid = true;
|
state.mIsValid = true;
|
||||||
if (DEBUG_EVENT) {
|
if (DEBUG_EVENT) {
|
||||||
|
@ -155,11 +146,7 @@ public final class KeyboardState {
|
||||||
if (!state.mIsValid || state.mIsAlphabetMode) {
|
if (!state.mIsValid || state.mIsAlphabetMode) {
|
||||||
setAlphabetKeyboard();
|
setAlphabetKeyboard();
|
||||||
} else {
|
} else {
|
||||||
if (state.mShiftMode == MANUAL_SHIFT) {
|
setSymbolsKeyboard();
|
||||||
setSymbolsShiftedKeyboard();
|
|
||||||
} else {
|
|
||||||
setSymbolsKeyboard();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!state.mIsValid) return;
|
if (!state.mIsValid) return;
|
||||||
|
@ -235,14 +222,8 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
if (mIsAlphabetMode) {
|
if (mIsAlphabetMode) {
|
||||||
mPrevMainKeyboardWasShiftLocked = mAlphabetShiftState.isShiftLocked();
|
mPrevMainKeyboardWasShiftLocked = mAlphabetShiftState.isShiftLocked();
|
||||||
if (mPrevSymbolsKeyboardWasShifted) {
|
setSymbolsKeyboard();
|
||||||
setSymbolsShiftedKeyboard();
|
|
||||||
} else {
|
|
||||||
setSymbolsKeyboard();
|
|
||||||
}
|
|
||||||
mPrevSymbolsKeyboardWasShifted = false;
|
|
||||||
} else {
|
} else {
|
||||||
mPrevSymbolsKeyboardWasShifted = mIsSymbolShifted;
|
|
||||||
setAlphabetKeyboard();
|
setAlphabetKeyboard();
|
||||||
if (mPrevMainKeyboardWasShiftLocked) {
|
if (mPrevMainKeyboardWasShiftLocked) {
|
||||||
setShiftLocked(true);
|
setShiftLocked(true);
|
||||||
|
@ -259,7 +240,6 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
if (mIsAlphabetMode) return;
|
if (mIsAlphabetMode) return;
|
||||||
|
|
||||||
mPrevSymbolsKeyboardWasShifted = mIsSymbolShifted;
|
|
||||||
setAlphabetKeyboard();
|
setAlphabetKeyboard();
|
||||||
if (mPrevMainKeyboardWasShiftLocked) {
|
if (mPrevMainKeyboardWasShiftLocked) {
|
||||||
setShiftLocked(true);
|
setShiftLocked(true);
|
||||||
|
@ -267,14 +247,6 @@ public final class KeyboardState {
|
||||||
mPrevMainKeyboardWasShiftLocked = false;
|
mPrevMainKeyboardWasShiftLocked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toggleShiftInSymbols() {
|
|
||||||
if (mIsSymbolShifted) {
|
|
||||||
setSymbolsKeyboard();
|
|
||||||
} else {
|
|
||||||
setSymbolsShiftedKeyboard();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setAlphabetKeyboard() {
|
private void setAlphabetKeyboard() {
|
||||||
if (DEBUG_ACTION) {
|
if (DEBUG_ACTION) {
|
||||||
Log.d(TAG, "setAlphabetKeyboard");
|
Log.d(TAG, "setAlphabetKeyboard");
|
||||||
|
@ -282,7 +254,6 @@ public final class KeyboardState {
|
||||||
|
|
||||||
mSwitchActions.setAlphabetKeyboard();
|
mSwitchActions.setAlphabetKeyboard();
|
||||||
mIsAlphabetMode = true;
|
mIsAlphabetMode = true;
|
||||||
mIsSymbolShifted = false;
|
|
||||||
mRecapitalizeMode = RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE;
|
mRecapitalizeMode = RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE;
|
||||||
mSwitchState = SWITCH_STATE_ALPHA;
|
mSwitchState = SWITCH_STATE_ALPHA;
|
||||||
mSwitchActions.requestUpdatingShiftState();
|
mSwitchActions.requestUpdatingShiftState();
|
||||||
|
@ -294,19 +265,6 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
mSwitchActions.setSymbolsKeyboard();
|
mSwitchActions.setSymbolsKeyboard();
|
||||||
mIsAlphabetMode = false;
|
mIsAlphabetMode = false;
|
||||||
mIsSymbolShifted = false;
|
|
||||||
// Reset alphabet shift state.
|
|
||||||
mAlphabetShiftState.setShiftLocked(false);
|
|
||||||
mSwitchState = SWITCH_STATE_SYMBOL_BEGIN;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setSymbolsShiftedKeyboard() {
|
|
||||||
if (DEBUG_ACTION) {
|
|
||||||
Log.d(TAG, "setSymbolsShiftedKeyboard");
|
|
||||||
}
|
|
||||||
mSwitchActions.setSymbolsShiftedKeyboard();
|
|
||||||
mIsAlphabetMode = false;
|
|
||||||
mIsSymbolShifted = true;
|
|
||||||
// Reset alphabet shift state.
|
// Reset alphabet shift state.
|
||||||
mAlphabetShiftState.setShiftLocked(false);
|
mAlphabetShiftState.setShiftLocked(false);
|
||||||
mSwitchState = SWITCH_STATE_SYMBOL_BEGIN;
|
mSwitchState = SWITCH_STATE_SYMBOL_BEGIN;
|
||||||
|
@ -359,7 +317,7 @@ public final class KeyboardState {
|
||||||
} else if (code == Constants.CODE_CAPSLOCK) {
|
} else if (code == Constants.CODE_CAPSLOCK) {
|
||||||
setShiftLocked(!mAlphabetShiftState.isShiftLocked());
|
setShiftLocked(!mAlphabetShiftState.isShiftLocked());
|
||||||
} else if (code == Constants.CODE_SWITCH_ALPHA_SYMBOL) {
|
} else if (code == Constants.CODE_SWITCH_ALPHA_SYMBOL) {
|
||||||
onReleaseSymbol(withSliding);
|
onReleaseSymbol();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,16 +327,11 @@ public final class KeyboardState {
|
||||||
mSwitchState = SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL;
|
mSwitchState = SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onReleaseSymbol(final boolean withSliding) {
|
private void onReleaseSymbol() {
|
||||||
if (mSymbolKeyState.isChording()) {
|
if (mSymbolKeyState.isChording()) {
|
||||||
// Switch back to the previous keyboard mode if the user chords the mode change key and
|
// Switch back to the previous keyboard mode if the user chords the mode change key and
|
||||||
// another key, then releases the mode change key.
|
// another key, then releases the mode change key.
|
||||||
toggleAlphabetAndSymbols();
|
toggleAlphabetAndSymbols();
|
||||||
} else if (!withSliding) {
|
|
||||||
// If the mode change key is being released without sliding, we should forget the
|
|
||||||
// previous symbols keyboard shift state and simply switch back to symbols layout
|
|
||||||
// (never symbols shifted) next time the mode gets changed to symbols layout.
|
|
||||||
mPrevSymbolsKeyboardWasShifted = false;
|
|
||||||
}
|
}
|
||||||
mSymbolKeyState.onRelease();
|
mSymbolKeyState.onRelease();
|
||||||
}
|
}
|
||||||
|
@ -444,47 +397,43 @@ public final class KeyboardState {
|
||||||
if (RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE != mRecapitalizeMode) {
|
if (RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE != mRecapitalizeMode) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mIsAlphabetMode) {
|
if (!mIsAlphabetMode) {
|
||||||
mIsInDoubleTapShiftKey = mSwitchActions.isInDoubleTapShiftKeyTimeout();
|
// There is no shift key on symbols keyboard.
|
||||||
if (!mIsInDoubleTapShiftKey) {
|
return;
|
||||||
// This is first tap.
|
}
|
||||||
mSwitchActions.startDoubleTapShiftKeyTimer();
|
mIsInDoubleTapShiftKey = mSwitchActions.isInDoubleTapShiftKeyTimeout();
|
||||||
}
|
if (!mIsInDoubleTapShiftKey) {
|
||||||
if (mIsInDoubleTapShiftKey) {
|
// This is first tap.
|
||||||
if (mAlphabetShiftState.isManualShifted() || mIsInAlphabetUnshiftedFromShifted) {
|
mSwitchActions.startDoubleTapShiftKeyTimer();
|
||||||
// Shift key has been double tapped while in manual shifted or automatic
|
}
|
||||||
// shifted state.
|
if (mIsInDoubleTapShiftKey) {
|
||||||
setShiftLocked(true);
|
if (mAlphabetShiftState.isManualShifted() || mIsInAlphabetUnshiftedFromShifted) {
|
||||||
} else {
|
// Shift key has been double tapped while in manual shifted or automatic
|
||||||
// Shift key has been double tapped while in normal state. This is the second
|
// shifted state.
|
||||||
// tap to disable shift locked state, so just ignore this.
|
setShiftLocked(true);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (mAlphabetShiftState.isShiftLocked()) {
|
// Shift key has been double tapped while in normal state. This is the second
|
||||||
// Shift key is pressed while shift locked state, we will treat this state as
|
// tap to disable shift locked state, so just ignore this.
|
||||||
// shift lock shifted state and mark as if shift key pressed while normal state.
|
|
||||||
setShifted(SHIFT_LOCK_SHIFTED);
|
|
||||||
mShiftKeyState.onPress();
|
|
||||||
} else if (mAlphabetShiftState.isAutomaticShifted()) {
|
|
||||||
// Shift key is pressed while automatic shifted, we have to move to manual
|
|
||||||
// shifted.
|
|
||||||
setShifted(MANUAL_SHIFT);
|
|
||||||
mShiftKeyState.onPress();
|
|
||||||
} else if (mAlphabetShiftState.isShiftedOrShiftLocked()) {
|
|
||||||
// In manual shifted state, we just record shift key has been pressing while
|
|
||||||
// shifted state.
|
|
||||||
mShiftKeyState.onPressOnShifted();
|
|
||||||
} else {
|
|
||||||
// In base layout, chording or manual shifted mode is started.
|
|
||||||
setShifted(MANUAL_SHIFT);
|
|
||||||
mShiftKeyState.onPress();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// In symbol mode, just toggle symbol and symbol more keyboard.
|
if (mAlphabetShiftState.isShiftLocked()) {
|
||||||
toggleShiftInSymbols();
|
// Shift key is pressed while shift locked state, we will treat this state as
|
||||||
mSwitchState = SWITCH_STATE_MOMENTARY_SYMBOL_AND_MORE;
|
// shift lock shifted state and mark as if shift key pressed while normal state.
|
||||||
mShiftKeyState.onPress();
|
setShifted(SHIFT_LOCK_SHIFTED);
|
||||||
|
mShiftKeyState.onPress();
|
||||||
|
} else if (mAlphabetShiftState.isAutomaticShifted()) {
|
||||||
|
// Shift key is pressed while automatic shifted, we have to move to manual shifted.
|
||||||
|
setShifted(MANUAL_SHIFT);
|
||||||
|
mShiftKeyState.onPress();
|
||||||
|
} else if (mAlphabetShiftState.isShiftedOrShiftLocked()) {
|
||||||
|
// In manual shifted state, we just record shift key has been pressing while
|
||||||
|
// shifted state.
|
||||||
|
mShiftKeyState.onPressOnShifted();
|
||||||
|
} else {
|
||||||
|
// In base layout, chording or manual shifted mode is started.
|
||||||
|
setShifted(MANUAL_SHIFT);
|
||||||
|
mShiftKeyState.onPress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -539,11 +488,7 @@ public final class KeyboardState {
|
||||||
mIsInAlphabetUnshiftedFromShifted = true;
|
mIsInAlphabetUnshiftedFromShifted = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// In symbol mode, switch back to the previous keyboard mode if the user chords the
|
// There is no shift key on symbols keyboard.
|
||||||
// shift key and another key, then releases the shift key.
|
|
||||||
if (mShiftKeyState.isChording()) {
|
|
||||||
toggleShiftInSymbols();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mShiftKeyState.onRelease();
|
mShiftKeyState.onRelease();
|
||||||
}
|
}
|
||||||
|
@ -557,9 +502,6 @@ public final class KeyboardState {
|
||||||
case SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL:
|
case SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL:
|
||||||
toggleAlphabetAndSymbols();
|
toggleAlphabetAndSymbols();
|
||||||
break;
|
break;
|
||||||
case SWITCH_STATE_MOMENTARY_SYMBOL_AND_MORE:
|
|
||||||
toggleShiftInSymbols();
|
|
||||||
break;
|
|
||||||
case SWITCH_STATE_MOMENTARY_ALPHA_SHIFT:
|
case SWITCH_STATE_MOMENTARY_ALPHA_SHIFT:
|
||||||
setAlphabetKeyboard();
|
setAlphabetKeyboard();
|
||||||
break;
|
break;
|
||||||
|
@ -587,12 +529,6 @@ public final class KeyboardState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SWITCH_STATE_MOMENTARY_SYMBOL_AND_MORE:
|
|
||||||
if (code == Constants.CODE_SHIFT) {
|
|
||||||
// Detected only the shift key has been pressed on symbol layout, and then released.
|
|
||||||
mSwitchState = SWITCH_STATE_SYMBOL_BEGIN;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SWITCH_STATE_SYMBOL_BEGIN:
|
case SWITCH_STATE_SYMBOL_BEGIN:
|
||||||
if (!isSpaceCharacter(code) && (Constants.isLetterCode(code)
|
if (!isSpaceCharacter(code) && (Constants.isLetterCode(code)
|
||||||
|| code == Constants.CODE_OUTPUT_TEXT)) {
|
|| code == Constants.CODE_OUTPUT_TEXT)) {
|
||||||
|
@ -604,7 +540,6 @@ public final class KeyboardState {
|
||||||
// characters followed by a space/enter.
|
// characters followed by a space/enter.
|
||||||
if (isSpaceCharacter(code)) {
|
if (isSpaceCharacter(code)) {
|
||||||
toggleAlphabetAndSymbols();
|
toggleAlphabetAndSymbols();
|
||||||
mPrevSymbolsKeyboardWasShifted = false;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -630,7 +565,6 @@ public final class KeyboardState {
|
||||||
case SWITCH_STATE_SYMBOL_BEGIN: return "SYMBOL-BEGIN";
|
case SWITCH_STATE_SYMBOL_BEGIN: return "SYMBOL-BEGIN";
|
||||||
case SWITCH_STATE_SYMBOL: return "SYMBOL";
|
case SWITCH_STATE_SYMBOL: return "SYMBOL";
|
||||||
case SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL: return "MOMENTARY-ALPHA-SYMBOL";
|
case SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL: return "MOMENTARY-ALPHA-SYMBOL";
|
||||||
case SWITCH_STATE_MOMENTARY_SYMBOL_AND_MORE: return "MOMENTARY-SYMBOL-MORE";
|
|
||||||
case SWITCH_STATE_MOMENTARY_ALPHA_SHIFT: return "MOMENTARY-ALPHA_SHIFT";
|
case SWITCH_STATE_MOMENTARY_ALPHA_SHIFT: return "MOMENTARY-ALPHA_SHIFT";
|
||||||
default: return null;
|
default: return null;
|
||||||
}
|
}
|
||||||
|
@ -638,8 +572,7 @@ public final class KeyboardState {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "[keyboard=" + (mIsAlphabetMode ? mAlphabetShiftState.toString()
|
return "[keyboard=" + (mIsAlphabetMode ? mAlphabetShiftState.toString() : "SYMBOLS")
|
||||||
: (mIsSymbolShifted ? "SYMBOLS_SHIFTED" : "SYMBOLS"))
|
|
||||||
+ " shift=" + mShiftKeyState
|
+ " shift=" + mShiftKeyState
|
||||||
+ " symbol=" + mSymbolKeyState
|
+ " symbol=" + mSymbolKeyState
|
||||||
+ " switch=" + switchStateToString(mSwitchState) + "]";
|
+ " switch=" + switchStateToString(mSwitchState) + "]";
|
||||||
|
|
|
@ -30,9 +30,9 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED);
|
releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Press "?123" key and hold, enter into choring symbols state.
|
// Press "?123" key and hold, enter into choring symbols state.
|
||||||
pressKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
|
pressKey(CODE_SYMBOL, SYMBOLS);
|
||||||
// Press/release symbol letter key.
|
// Press/release symbol letter key.
|
||||||
chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
chordingPressAndReleaseKey('1', SYMBOLS, SYMBOLS);
|
||||||
// Release "ABC" key, switch back to alphabet.
|
// Release "ABC" key, switch back to alphabet.
|
||||||
releaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
|
releaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
|
||||||
}
|
}
|
||||||
|
@ -50,9 +50,9 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
releaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED);
|
releaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED);
|
||||||
|
|
||||||
// Press "?123" key and hold, enter into choring symbols state.
|
// Press "?123" key and hold, enter into choring symbols state.
|
||||||
pressKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
|
pressKey(CODE_SYMBOL, SYMBOLS);
|
||||||
// Press/release symbol letter key.
|
// Press/release symbol letter key.
|
||||||
chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
chordingPressAndReleaseKey('1', SYMBOLS, SYMBOLS);
|
||||||
// Release "123?" key, switch back to alphabet unshifted.
|
// Release "123?" key, switch back to alphabet unshifted.
|
||||||
releaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
|
releaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
|
||||||
}
|
}
|
||||||
|
@ -71,9 +71,9 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
releaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCKED);
|
releaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCKED);
|
||||||
|
|
||||||
// Press "?123" key and hold, enter into choring symbols state.
|
// Press "?123" key and hold, enter into choring symbols state.
|
||||||
pressKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
|
pressKey(CODE_SYMBOL, SYMBOLS);
|
||||||
// Press/release symbol letter key.
|
// Press/release symbol letter key.
|
||||||
chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
chordingPressAndReleaseKey('1', SYMBOLS, SYMBOLS);
|
||||||
// Release "123?" key, switch back to alphabet shift locked.
|
// Release "123?" key, switch back to alphabet shift locked.
|
||||||
releaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED);
|
releaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED);
|
||||||
}
|
}
|
||||||
|
@ -81,21 +81,14 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
// Chording input in symbols.
|
// Chording input in symbols.
|
||||||
public void testChordingSymbols() {
|
public void testChordingSymbols() {
|
||||||
// Press/release "?123" key, enter symbols.
|
// Press/release "?123" key, enter symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
|
|
||||||
// Press "=\<" key and hold, enter into choring symbols shifted state.
|
|
||||||
pressKey(CODE_SHIFT, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release symbol letter key.
|
|
||||||
chordingPressAndReleaseKey('1', SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Release "=\<" key, switch back to symbols.
|
|
||||||
releaseKey(CODE_SHIFT, SYMBOLS_UNSHIFTED);
|
|
||||||
|
|
||||||
// Press "ABC" key and hold, enter into choring alphabet state.
|
// Press "ABC" key and hold, enter into choring alphabet state.
|
||||||
pressKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
|
pressKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
|
||||||
// Press/release letter key.
|
// Press/release letter key.
|
||||||
chordingPressAndReleaseKey('a', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
chordingPressAndReleaseKey('a', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
// Release "ABC" key, switch back to symbols.
|
// Release "ABC" key, switch back to symbols.
|
||||||
releaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
|
releaseKey(CODE_SYMBOL, SYMBOLS);
|
||||||
|
|
||||||
// Alphabet shifted -> symbols -> "ABC" key + letter -> symbols
|
// Alphabet shifted -> symbols -> "ABC" key + letter -> symbols
|
||||||
// -> alphabet.
|
// -> alphabet.
|
||||||
|
@ -104,13 +97,13 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
// Press/release shift key, enter alphabet shifted.
|
// Press/release shift key, enter alphabet shifted.
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Press "ABC" key, enter into chording alphabet state.
|
// Press "ABC" key, enter into chording alphabet state.
|
||||||
pressKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
|
pressKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
|
||||||
// Enter/release letter key.
|
// Enter/release letter key.
|
||||||
chordingPressAndReleaseKey('a', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
chordingPressAndReleaseKey('a', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
// Release "ABC" key, switch back to symbols.
|
// Release "ABC" key, switch back to symbols.
|
||||||
releaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
|
releaseKey(CODE_SYMBOL, SYMBOLS);
|
||||||
// Press/release "ABC" key, switch to alphabet (not alphabet shifted).
|
// Press/release "ABC" key, switch to alphabet (not alphabet shifted).
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
|
@ -122,112 +115,13 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Press "ABC" key, enter into chording alphabet shift locked.
|
// Press "ABC" key, enter into chording alphabet shift locked.
|
||||||
pressKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED);
|
pressKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED);
|
||||||
// Enter/release letter key.
|
// Enter/release letter key.
|
||||||
chordingPressAndReleaseKey('A', ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
chordingPressAndReleaseKey('A', ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
||||||
// Release "ABC" key, switch back to symbols.
|
// Release "ABC" key, switch back to symbols.
|
||||||
releaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
|
releaseKey(CODE_SYMBOL, SYMBOLS);
|
||||||
// Press/release "ABC" key, switch to alphabet shift locked.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
|
|
||||||
// Alphabet shift locked -> symbols -> "=\<" key + letter -> symbols ->
|
|
||||||
// alphabet shift locked.
|
|
||||||
// Load keyboard
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
|
||||||
ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press "=\<" key, enter into symbols shifted chording state.
|
|
||||||
pressKey(CODE_SHIFT, SYMBOLS_SHIFTED);
|
|
||||||
// Enter/release symbols shift letter key.
|
|
||||||
chordingPressAndReleaseKey('~', SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Release "=\<" key, switch back to symbols.
|
|
||||||
releaseKey(CODE_SHIFT, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet shift locked.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Chording input in symbol shifted.
|
|
||||||
public void testChordingSymbolsShifted() {
|
|
||||||
// Press/release "?123" key, enter symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
|
|
||||||
// Press "?123" key and hold, enter into chording symbols state.
|
|
||||||
pressKey(CODE_SHIFT, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release symbol letter key.
|
|
||||||
chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Release "=\<" key, switch back to symbols shifted state.
|
|
||||||
releaseKey(CODE_SHIFT, SYMBOLS_SHIFTED);
|
|
||||||
|
|
||||||
// Press "ABC" key and hold, enter into choring alphabet state.
|
|
||||||
pressKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
|
|
||||||
// Press/release letter key.
|
|
||||||
chordingPressAndReleaseKey('a', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
// Release "ABC" key, switch back to symbols.
|
|
||||||
releaseKey(CODE_SYMBOL, SYMBOLS_SHIFTED);
|
|
||||||
|
|
||||||
// Alphabet shifted -> symbols shifted -> "ABC" key + letter -> symbols shifted ->
|
|
||||||
// alphabet.
|
|
||||||
// Load keyboard
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Press/release shift key, enter alphabet shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press "ABC" key, enter into chording alphabet state.
|
|
||||||
pressKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
|
|
||||||
// Enter/release letter key.
|
|
||||||
chordingPressAndReleaseKey('a', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
// Release "ABC" key, switch back to symbols shifted.
|
|
||||||
releaseKey(CODE_SYMBOL, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet (not alphabet shifted).
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
|
|
||||||
// Alphabet shift locked -> symbols shifted -> "ABC" key + letter -> symbols shifted
|
|
||||||
// -> alphabet shift locked.
|
|
||||||
// Load keyboard
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
|
||||||
ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press "ABC" key, enter into chording alphabet shift locked.
|
|
||||||
pressKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Enter/release letter key.
|
|
||||||
chordingPressAndReleaseKey('A', ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Release "ABC" key, switch back to symbols shifted.
|
|
||||||
releaseKey(CODE_SYMBOL, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet shift locked.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
|
|
||||||
// Alphabet shift locked -> symbols shifted -> "=\<" key + letter -> symbols shifted
|
|
||||||
// -> alphabet shift locked.
|
|
||||||
// Load keyboard
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
|
||||||
ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press "=\<" key, enter into symbols chording state.
|
|
||||||
pressKey(CODE_SHIFT, SYMBOLS_UNSHIFTED);
|
|
||||||
// Enter/release symbols letter key.
|
|
||||||
chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Release "=\<" key, switch back to symbols shifted.
|
|
||||||
releaseKey(CODE_SHIFT, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet shift locked.
|
// Press/release "ABC" key, switch to alphabet shift locked.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
||||||
}
|
}
|
||||||
|
@ -249,9 +143,9 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
// Update shift state with auto caps enabled.
|
// Update shift state with auto caps enabled.
|
||||||
pressAndReleaseKey(CODE_AUTO_CAPS_TRIGGER, ALPHABET_UNSHIFTED, ALPHABET_AUTOMATIC_SHIFTED);
|
pressAndReleaseKey(CODE_AUTO_CAPS_TRIGGER, ALPHABET_UNSHIFTED, ALPHABET_AUTOMATIC_SHIFTED);
|
||||||
// Press "123?" key and hold, enter into chording symbols state.
|
// Press "123?" key and hold, enter into chording symbols state.
|
||||||
pressKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
|
pressKey(CODE_SYMBOL, SYMBOLS);
|
||||||
// Press/release symbol letter key.
|
// Press/release symbol letter key.
|
||||||
chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
chordingPressAndReleaseKey('1', SYMBOLS, SYMBOLS);
|
||||||
// Release "123?" key, switch back to alphabet.
|
// Release "123?" key, switch back to alphabet.
|
||||||
releaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
|
releaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,38 +34,14 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
pressAndReleaseKey('Z', ALPHABET_MANUAL_SHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey('Z', ALPHABET_MANUAL_SHIFTED, ALPHABET_UNSHIFTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shift key in symbols.
|
|
||||||
public void testShiftSymbols() {
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
|
|
||||||
// Press/release "?123" key, back to symbols.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release symbol letter key, remain in symbols shifted.
|
|
||||||
pressAndReleaseKey('1', SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Switching between alphabet and symbols.
|
// Switching between alphabet and symbols.
|
||||||
public void testAlphabetAndSymbols() {
|
public void testAlphabetAndSymbols() {
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Press/release "ABC" key, back to alphabet.
|
// Press/release "ABC" key, back to alphabet.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, back to alphabet.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
// Press/release "?123" key, back to symbols (not symbols shifted).
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switching between alphabet shifted and symbols.
|
// Switching between alphabet shifted and symbols.
|
||||||
|
@ -74,16 +50,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Press/release "ABC" key, back to alphabet (not alphabet shifted).
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
|
|
||||||
// Press/release shift key, enter into alphabet shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\< key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, back to alphabet (not alphabet shifted).
|
// Press/release "ABC" key, back to alphabet (not alphabet shifted).
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
}
|
}
|
||||||
|
@ -95,39 +62,21 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Press/release "ABC" key, back to alphabet shift locked.
|
// Press/release "ABC" key, back to alphabet shift locked.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, back to alphabet shift locked.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Press/release "?123" key, back to symbols (not symbols shifted).
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Automatic switch back to alphabet by space key.
|
// Automatic switch back to alphabet by space key.
|
||||||
public void testSwitchBackBySpace() {
|
public void testSwitchBackBySpace() {
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Enter symbol letter.
|
// Enter symbol letter.
|
||||||
pressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey('1', SYMBOLS, SYMBOLS);
|
||||||
// Enter space, switch back to alphabet.
|
// Enter space, switch back to alphabet.
|
||||||
pressAndReleaseKey(CODE_SPACE, SYMBOLS_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SPACE, SYMBOLS, ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Enter symbol shift letter.
|
|
||||||
pressAndReleaseKey('~', SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Enter space, switch back to alphabet.
|
|
||||||
pressAndReleaseKey(CODE_SPACE, SYMBOLS_SHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
// Press/release "?123" key, enter into symbols (not symbols shifted).
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Automatic switch back to alphabet shift locked test by space key.
|
// Automatic switch back to alphabet shift locked test by space key.
|
||||||
|
@ -137,20 +86,11 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Enter symbol letter.
|
// Enter symbol letter.
|
||||||
pressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey('1', SYMBOLS, SYMBOLS);
|
||||||
// Enter space, switch back to alphabet shift locked.
|
// Enter space, switch back to alphabet shift locked.
|
||||||
pressAndReleaseKey(CODE_SPACE, SYMBOLS_UNSHIFTED, ALPHABET_SHIFT_LOCKED);
|
pressAndReleaseKey(CODE_SPACE, SYMBOLS, ALPHABET_SHIFT_LOCKED);
|
||||||
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Enter symbol shift letter.
|
|
||||||
pressAndReleaseKey('~', SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Enter space, switch back to alphabet shift locked.
|
|
||||||
pressAndReleaseKey(CODE_SPACE, SYMBOLS_SHIFTED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Automatic upper case test
|
// Automatic upper case test
|
||||||
|
@ -173,20 +113,11 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
pressAndReleaseKey(CODE_AUTO_CAPS_TRIGGER, ALPHABET_UNSHIFTED, ALPHABET_AUTOMATIC_SHIFTED);
|
pressAndReleaseKey(CODE_AUTO_CAPS_TRIGGER, ALPHABET_UNSHIFTED, ALPHABET_AUTOMATIC_SHIFTED);
|
||||||
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Press/release symbol letter key, remain in symbols.
|
// Press/release symbol letter key, remain in symbols.
|
||||||
pressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey('1', SYMBOLS, SYMBOLS);
|
||||||
// Press/release space, switch back to automatic shifted.
|
// Press/release space, switch back to automatic shifted.
|
||||||
pressAndReleaseKey(CODE_SPACE, SYMBOLS_UNSHIFTED, ALPHABET_AUTOMATIC_SHIFTED);
|
pressAndReleaseKey(CODE_SPACE, SYMBOLS, ALPHABET_AUTOMATIC_SHIFTED);
|
||||||
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release symbol shift letter key, remain in symbols shifted.
|
|
||||||
pressAndReleaseKey('~', SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release space, switch back to automatic shifted.
|
|
||||||
pressAndReleaseKey(CODE_SPACE, SYMBOLS_SHIFTED, ALPHABET_AUTOMATIC_SHIFTED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Long press shift key.
|
// Long press shift key.
|
||||||
|
@ -302,14 +233,9 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
ALPHABET_UNSHIFTED);
|
ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Update shift state, remained in symbols.
|
// Update shift state, remained in symbols.
|
||||||
updateShiftState(SYMBOLS_UNSHIFTED);
|
updateShiftState(SYMBOLS);
|
||||||
|
|
||||||
// Press/release "=\<" key, enter symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Update shift state, remained in symbols shifted.
|
|
||||||
updateShiftState(SYMBOLS_SHIFTED);
|
|
||||||
|
|
||||||
// Set capitalize the first character of all words mode.
|
// Set capitalize the first character of all words mode.
|
||||||
setAutoCapsMode(CAP_MODE_WORDS);
|
setAutoCapsMode(CAP_MODE_WORDS);
|
||||||
|
@ -337,14 +263,9 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Load keyboard, should be in automatic shifted.
|
// Load keyboard, should be in automatic shifted.
|
||||||
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Update shift state, remained in symbols.
|
// Update shift state, remained in symbols.
|
||||||
updateShiftState(SYMBOLS_UNSHIFTED);
|
updateShiftState(SYMBOLS);
|
||||||
|
|
||||||
// Press/release "=\<" key, enter symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Update shift state, remained in symbols shifted.
|
|
||||||
updateShiftState(SYMBOLS_SHIFTED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sliding input in alphabet.
|
// Sliding input in alphabet.
|
||||||
|
@ -358,10 +279,10 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
|
|
||||||
// Alphabet -> "?123" key + letter -> alphabet.
|
// Alphabet -> "?123" key + letter -> alphabet.
|
||||||
// Press and slide from "123?" key, enter symbols.
|
// Press and slide from "123?" key, enter symbols.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Enter/release into symbol letter keys, switch back to alphabet.
|
// Enter/release into symbol letter keys, switch back to alphabet.
|
||||||
pressAndSlideFromKey('@', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey('@', SYMBOLS, SYMBOLS);
|
||||||
stopSlidingOnKey('!', SYMBOLS_UNSHIFTED, ALPHABET_UNSHIFTED);
|
stopSlidingOnKey('!', SYMBOLS, ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Alphabet shifted -> shift key + letter -> alphabet.
|
// Alphabet shifted -> shift key + letter -> alphabet.
|
||||||
// Press/release shift key, enter alphabet shifted.
|
// Press/release shift key, enter alphabet shifted.
|
||||||
|
@ -376,20 +297,20 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Press/release shift key, enter alphabet shifted.
|
// Press/release shift key, enter alphabet shifted.
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
// Press and slide from "123?" key, enter symbols.
|
// Press and slide from "123?" key, enter symbols.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Enter/release into symbol letter keys, switch back to alphabet (not alphabet shifted).
|
// Enter/release into symbol letter keys, switch back to alphabet (not alphabet shifted).
|
||||||
pressAndSlideFromKey('@', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey('@', SYMBOLS, SYMBOLS);
|
||||||
stopSlidingOnKey('!', SYMBOLS_UNSHIFTED, ALPHABET_UNSHIFTED);
|
stopSlidingOnKey('!', SYMBOLS, ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Alphabet shift locked -> shift key + letter -> alphabet shift locked.
|
// Alphabet shift locked -> shift key + letter -> alphabet shift locked.
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press and slide from "123?" key, enter symbols.
|
// Press and slide from "123?" key, enter symbols.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Enter/release into symbol letter keys, switch back to alphabet shift locked.
|
// Enter/release into symbol letter keys, switch back to alphabet shift locked.
|
||||||
pressAndSlideFromKey('!', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey('!', SYMBOLS, SYMBOLS);
|
||||||
stopSlidingOnKey('!', SYMBOLS_UNSHIFTED, ALPHABET_SHIFT_LOCKED);
|
stopSlidingOnKey('!', SYMBOLS, ALPHABET_SHIFT_LOCKED);
|
||||||
|
|
||||||
// Alphabet shift locked -> "?123" key + letter -> alphabet shift locked.
|
// Alphabet shift locked -> "?123" key + letter -> alphabet shift locked.
|
||||||
// Press and slide from shift key, enter alphabet shifted.
|
// Press and slide from shift key, enter alphabet shifted.
|
||||||
|
@ -413,9 +334,9 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
|
|
||||||
// Alphabet -> "?123" key + letter -> cancel -> alphabet.
|
// Alphabet -> "?123" key + letter -> cancel -> alphabet.
|
||||||
// Press and slide from "123?" key, enter symbols.
|
// Press and slide from "123?" key, enter symbols.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Enter/release into symbol letter key, remains in symbols.
|
// Enter/release into symbol letter key, remains in symbols.
|
||||||
pressAndSlideFromKey('!', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey('!', SYMBOLS, SYMBOLS);
|
||||||
// Cancel sliding, switch back to alphabet.
|
// Cancel sliding, switch back to alphabet.
|
||||||
stopSlidingAndCancel(ALPHABET_UNSHIFTED);
|
stopSlidingAndCancel(ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
|
@ -433,9 +354,9 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Press/release shift key, enter alphabet shifted.
|
// Press/release shift key, enter alphabet shifted.
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
// Press and slide from "123?" key, enter symbols.
|
// Press and slide from "123?" key, enter symbols.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Enter/release into symbol letter key, remains in symbols.
|
// Enter/release into symbol letter key, remains in symbols.
|
||||||
pressAndSlideFromKey('!', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey('!', SYMBOLS, SYMBOLS);
|
||||||
// Cancel sliding, switch back to alphabet (not alphabet shifted).
|
// Cancel sliding, switch back to alphabet (not alphabet shifted).
|
||||||
stopSlidingAndCancel(ALPHABET_UNSHIFTED);
|
stopSlidingAndCancel(ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
|
@ -444,9 +365,9 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press and slide from "123?" key, enter symbols.
|
// Press and slide from "123?" key, enter symbols.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Enter/release into symbol letter key, remains in symbols.
|
// Enter/release into symbol letter key, remains in symbols.
|
||||||
pressAndSlideFromKey('!', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey('!', SYMBOLS, SYMBOLS);
|
||||||
// Cancel sliding, switch back to alphabet shift locked.
|
// Cancel sliding, switch back to alphabet shift locked.
|
||||||
stopSlidingAndCancel( ALPHABET_SHIFT_LOCKED);
|
stopSlidingAndCancel( ALPHABET_SHIFT_LOCKED);
|
||||||
|
|
||||||
|
@ -461,21 +382,14 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
|
|
||||||
// Sliding input in symbols.
|
// Sliding input in symbols.
|
||||||
public void testSlidingSymbols() {
|
public void testSlidingSymbols() {
|
||||||
// Symbols -> "=\<" key + letter -> symbols.
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Press and slide from shift key, enter symbols shifted.
|
|
||||||
pressAndSlideFromKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Enter/release symbol shifted letter keys, switch back to symbols.
|
|
||||||
pressAndSlideFromKey('|', SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
stopSlidingOnKey('~', SYMBOLS_SHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
|
|
||||||
// Symbols -> "ABC" key + letter -> Symbols.
|
// Symbols -> "ABC" key + letter -> Symbols.
|
||||||
// Press and slide from "ABC" key, enter alphabet.
|
// Press and slide from "ABC" key, enter alphabet.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
// Enter/release letter keys, switch back to symbols.
|
// Enter/release letter keys, switch back to symbols.
|
||||||
pressAndSlideFromKey('z', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndSlideFromKey('z', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
stopSlidingOnKey('a', ALPHABET_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
stopSlidingOnKey('a', ALPHABET_UNSHIFTED, SYMBOLS);
|
||||||
// Press/release "ABC" key, switch to alphabet.
|
// Press/release "ABC" key, switch to alphabet.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
|
@ -486,12 +400,12 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Press/release shift key, enter alphabet shifted.
|
// Press/release shift key, enter alphabet shifted.
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Press and slide from "ABC" key.
|
// Press and slide from "ABC" key.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
// Enter/release letter keys, switch back to symbols.
|
// Enter/release letter keys, switch back to symbols.
|
||||||
pressAndSlideFromKey('z', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndSlideFromKey('z', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
stopSlidingOnKey('a', ALPHABET_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
stopSlidingOnKey('a', ALPHABET_UNSHIFTED, SYMBOLS);
|
||||||
// Press/release "ABC" key, switch to alphabet (not alphabet shifted).
|
// Press/release "ABC" key, switch to alphabet (not alphabet shifted).
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
|
@ -503,52 +417,27 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Press and slide from "ABC" key, enter alphabet shift locked.
|
// Press and slide from "ABC" key, enter alphabet shift locked.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
||||||
// Enter/release letter keys, switch back to symbols.
|
// Enter/release letter keys, switch back to symbols.
|
||||||
pressAndSlideFromKey('Z', ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
pressAndSlideFromKey('Z', ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
||||||
stopSlidingOnKey('A', ALPHABET_SHIFT_LOCKED, SYMBOLS_UNSHIFTED);
|
stopSlidingOnKey('A', ALPHABET_SHIFT_LOCKED, SYMBOLS);
|
||||||
// Press/release "ABC" key, switch to alphabet shift locked.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
|
|
||||||
// Alphabet shift locked -> symbols -> "=\<" key + letter -> symbols ->
|
|
||||||
// alphabet shift locked.
|
|
||||||
// Load keyboard
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
|
||||||
ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press and slide from "=\<" key, enter symbols shifted.
|
|
||||||
pressAndSlideFromKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Enter/release symbols shift letter keys, switch back to symbols.
|
|
||||||
pressAndSlideFromKey('|', SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
stopSlidingOnKey('~', SYMBOLS_SHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet shift locked.
|
// Press/release "ABC" key, switch to alphabet shift locked.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cancel sliding input in symbols.
|
// Cancel sliding input in symbols.
|
||||||
public void testSlidingSymbolsCancel() {
|
public void testSlidingSymbolsCancel() {
|
||||||
// Symbols -> "=\<" key + letter -> cancel -> symbols.
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Press and slide from shift key, enter symbols shifted.
|
|
||||||
pressAndSlideFromKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Enter/release symbol shifted letter key, remains in symbols shifted.
|
|
||||||
pressAndSlideFromKey('|', SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Cancel sliding, switch back to symbols.
|
|
||||||
stopSlidingAndCancel(SYMBOLS_UNSHIFTED);
|
|
||||||
|
|
||||||
// Symbols -> "ABC" key + letter -> Symbols.
|
// Symbols -> "ABC" key + letter -> Symbols.
|
||||||
// Press and slide from "ABC" key, enter alphabet.
|
// Press and slide from "ABC" key, enter alphabet.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
// Enter/release letter keys, remains in alphabet.
|
// Enter/release letter keys, remains in alphabet.
|
||||||
pressAndSlideFromKey('z', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndSlideFromKey('z', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
// Cancel sliding, switch back to symbols.
|
// Cancel sliding, switch back to symbols.
|
||||||
stopSlidingAndCancel(SYMBOLS_UNSHIFTED);
|
stopSlidingAndCancel(SYMBOLS);
|
||||||
// Press/release "ABC" key, switch to alphabet.
|
// Press/release "ABC" key, switch to alphabet.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
|
@ -559,13 +448,13 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Press/release shift key, enter alphabet shifted.
|
// Press/release shift key, enter alphabet shifted.
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Press and slide from "ABC" key.
|
// Press and slide from "ABC" key.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
// Enter/release letter key, remains in alphabet.
|
// Enter/release letter key, remains in alphabet.
|
||||||
pressAndSlideFromKey('z', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndSlideFromKey('z', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
// Cancel sliding, switch back to symbols.
|
// Cancel sliding, switch back to symbols.
|
||||||
stopSlidingAndCancel(SYMBOLS_UNSHIFTED);
|
stopSlidingAndCancel(SYMBOLS);
|
||||||
// Press/release "ABC" key, switch to alphabet (not alphabet shifted).
|
// Press/release "ABC" key, switch to alphabet (not alphabet shifted).
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
|
@ -577,194 +466,13 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Press and slide from "ABC" key, enter alphabet shift locked.
|
// Press and slide from "ABC" key, enter alphabet shift locked.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
||||||
// Enter/release letter key, remains in alphabet shifted.
|
// Enter/release letter key, remains in alphabet shifted.
|
||||||
pressAndSlideFromKey('Z', ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
pressAndSlideFromKey('Z', ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
||||||
// Cancel sliding, switch back to symbols.
|
// Cancel sliding, switch back to symbols.
|
||||||
stopSlidingAndCancel(SYMBOLS_UNSHIFTED);
|
stopSlidingAndCancel(SYMBOLS);
|
||||||
// Press/release "ABC" key, switch to alphabet shift locked.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
|
|
||||||
// Alphabet shift locked -> symbols -> "=\<" key + letter -> symbols ->
|
|
||||||
// alphabet shift locked.
|
|
||||||
// Load keyboard
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
|
||||||
ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press and slide from "=\<" key, enter symbols shifted.
|
|
||||||
pressAndSlideFromKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Enter/release symbols shift letter key, remains in symbols shifted.
|
|
||||||
pressAndSlideFromKey('|', SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Cancel sliding, switch back to symbols.
|
|
||||||
stopSlidingAndCancel(SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet shift locked.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sliding input in symbols shifted.
|
|
||||||
public void testSlidingSymbolsShifted() {
|
|
||||||
// Symbols shifted -> "?123" + letter -> symbols shifted.
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press and slide from shift key, enter symbols.
|
|
||||||
pressAndSlideFromKey(CODE_SHIFT, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Enter/release symbol letter keys, switch back to symbols shifted.
|
|
||||||
pressAndSlideFromKey('2', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
stopSlidingOnKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
|
|
||||||
// Symbols shifted -> "ABC" key + letter -> symbols shifted.
|
|
||||||
// Press and slide from "ABC" key, enter alphabet.
|
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
// Enter/release letter keys, switch back to symbols shifted.
|
|
||||||
pressAndSlideFromKey('z', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
stopSlidingOnKey('a', ALPHABET_UNSHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
|
|
||||||
// Alphabet shifted -> symbols shifted -> "ABC" + letter -> symbols shifted ->
|
|
||||||
// alphabet.
|
|
||||||
// Load keyboard
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Press/release shift key, enter alphabet shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press and slide from "ABC" key.
|
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
// Enter/release letter keys, switch back to symbols shifted.
|
|
||||||
pressAndSlideFromKey('z', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
stopSlidingOnKey('a', ALPHABET_UNSHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet (not alphabet shifted).
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
|
|
||||||
// Alphabet shift locked -> symbols shifted -> "ABC" + letter -> symbols shifted ->
|
|
||||||
// alphabet shift locked.
|
|
||||||
// Load keyboard
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
|
||||||
ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press and slide from "ABC" key.
|
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Enter/release letter keys, switch back to symbols shifted.
|
|
||||||
pressAndSlideFromKey('Z', ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
stopSlidingOnKey('A', ALPHABET_SHIFT_LOCKED, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet shift locked.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
|
|
||||||
// Alphabet shift locked -> symbols shifted -> "?123" + letter -> symbols shifted ->
|
|
||||||
// alphabet shift locked.
|
|
||||||
// Load keyboard
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
|
||||||
ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press and slide from "?123" key.
|
|
||||||
pressAndSlideFromKey(CODE_SHIFT, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Enter/release symbol letter keys, switch back to symbols shifted.
|
|
||||||
pressAndSlideFromKey('2', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
stopSlidingOnKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet shift locked.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cancel sliding input in symbols shifted.
|
|
||||||
public void testSlidingSymbolsShiftedCancel() {
|
|
||||||
// Symbols shifted -> "?123" + letter -> symbols shifted.
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press and slide from shift key, enter symbols.
|
|
||||||
pressAndSlideFromKey(CODE_SHIFT, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Enter/release symbol letter key, remains in symbols.
|
|
||||||
pressAndSlideFromKey('2', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Cancel sliding, switch back to symbols shifted.
|
|
||||||
stopSlidingAndCancel(SYMBOLS_SHIFTED);
|
|
||||||
|
|
||||||
// Symbols shifted -> "ABC" key + letter -> symbols shifted.
|
|
||||||
// Press and slide from "ABC" key, enter alphabet.
|
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
// Enter/release letter key, remains in alphabet.
|
|
||||||
pressAndSlideFromKey('z', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
// Cancel sliding, switch back to symbols shifted.
|
|
||||||
stopSlidingAndCancel(SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
|
|
||||||
// Alphabet shifted -> symbols shifted -> "ABC" + letter -> symbols shifted ->
|
|
||||||
// alphabet.
|
|
||||||
// Load keyboard
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Press/release shift key, enter alphabet shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press and slide from "ABC" key.
|
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
// Enter/release letter key, remains in alphabet.
|
|
||||||
pressAndSlideFromKey('z', ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
// Cancel sliding, switch back to symbols shifted.
|
|
||||||
stopSlidingAndCancel(SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet (not alphabet shifted).
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
|
|
||||||
// Alphabet shift locked -> symbols shifted -> "ABC" + letter -> symbols shifted ->
|
|
||||||
// alphabet shift locked.
|
|
||||||
// Load keyboard
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
|
||||||
ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press and slide from "ABC" key.
|
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Enter/release letter key, remains in alphabet shift locked.
|
|
||||||
pressAndSlideFromKey('Z', ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Cancel sliding, switch back to symbols shifted.
|
|
||||||
stopSlidingAndCancel(SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet shift locked.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
|
|
||||||
// Alphabet shift locked -> symbols shifted -> "?123" + letter -> symbols shifted ->
|
|
||||||
// alphabet shift locked.
|
|
||||||
// Load keyboard
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
|
||||||
longPressAndReleaseShiftKey(ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
|
||||||
ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter into symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press and slide from "?123" key.
|
|
||||||
pressAndSlideFromKey(CODE_SHIFT, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Enter/release symbol letter key, remains in symbols.
|
|
||||||
pressAndSlideFromKey('2', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Cancel sliding, switch back to symbols shifted.
|
|
||||||
stopSlidingAndCancel(SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, switch to alphabet shift locked.
|
// Press/release "ABC" key, switch to alphabet shift locked.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
||||||
}
|
}
|
||||||
|
@ -783,14 +491,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Press/release "?123" key.
|
// Press/release "?123" key.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Change focus to new text field.
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
|
|
||||||
// Press/release "?123" key.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Change focus to new text field.
|
// Change focus to new text field.
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
}
|
}
|
||||||
|
@ -814,14 +515,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
||||||
|
|
||||||
// Press/release "?123" key.
|
// Press/release "?123" key.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Change focus to new text field.
|
|
||||||
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
|
||||||
|
|
||||||
// Press/release "?123" key.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Change focus to new text field.
|
// Change focus to new text field.
|
||||||
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
||||||
}
|
}
|
||||||
|
@ -860,49 +554,11 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Alphabet shift locked -> symbols -> rotate -> symbols ->
|
// Alphabet shift locked -> symbols -> rotate -> symbols ->
|
||||||
// Alphabet shift locked.
|
// Alphabet shift locked.
|
||||||
// Press/release "?123" key, enter symbols.
|
// Press/release "?123" key, enter symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS);
|
||||||
// Rotate device, remain in symbols,
|
// Rotate device, remain in symbols,
|
||||||
rotateDevice(SYMBOLS_UNSHIFTED);
|
rotateDevice(SYMBOLS);
|
||||||
// Press/release "ABC" key, alphabet shift locked state should be maintained.
|
// Press/release "ABC" key, alphabet shift locked state should be maintained.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
||||||
|
|
||||||
// Alphabet shift locked -> symbols shifted -> rotate -> symbols shifted ->
|
|
||||||
// Alphabet shift locked.
|
|
||||||
// Press/release "?123" key, enter symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Rotate device, remain in symbols shifted.
|
|
||||||
rotateDevice(SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, alphabet shift locked state should be maintained.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
|
|
||||||
// Alphabet shift locked -> symbols shifted -> alphabet shift locked -> rotate ->
|
|
||||||
// Alphabet shift locked -> symbols.
|
|
||||||
// Press/release "?123" key, enter symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, enter alphabet shift locked.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Rotate device, remain in alphabet shift locked.
|
|
||||||
rotateDevice(ALPHABET_SHIFT_LOCKED);
|
|
||||||
// Press/release "?123" key, enter symbols (not symbols shifted).
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
|
|
||||||
// Alphabet -> symbols shifted -> alphabet -> rotate ->
|
|
||||||
// Alphabet -> symbols.
|
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
|
||||||
// Press/release "?123" key, enter symbols.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
// Press/release "=\<" key, enter symbols shifted.
|
|
||||||
pressAndReleaseKey(CODE_SHIFT, SYMBOLS_SHIFTED, SYMBOLS_SHIFTED);
|
|
||||||
// Press/release "ABC" key, enter alphabet.
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED, ALPHABET_UNSHIFTED);
|
|
||||||
// Rotate device, remain in alphabet shift locked.
|
|
||||||
rotateDevice(ALPHABET_UNSHIFTED);
|
|
||||||
// Press/release "?123" key, enter symbols (not symbols shifted).
|
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rapidly type shift key.
|
// Rapidly type shift key.
|
||||||
|
|
|
@ -43,8 +43,7 @@ public class MockKeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
public static final int ALPHABET_AUTOMATIC_SHIFTED = 2;
|
public static final int ALPHABET_AUTOMATIC_SHIFTED = 2;
|
||||||
public static final int ALPHABET_SHIFT_LOCKED = 3;
|
public static final int ALPHABET_SHIFT_LOCKED = 3;
|
||||||
public static final int ALPHABET_SHIFT_LOCK_SHIFTED = 4;
|
public static final int ALPHABET_SHIFT_LOCK_SHIFTED = 4;
|
||||||
public static final int SYMBOLS_UNSHIFTED = 5;
|
public static final int SYMBOLS = 5;
|
||||||
public static final int SYMBOLS_SHIFTED = 6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int mLayout = MockConstants.ALPHABET_UNSHIFTED;
|
private int mLayout = MockConstants.ALPHABET_UNSHIFTED;
|
||||||
|
@ -69,8 +68,7 @@ public class MockKeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
case MockConstants.ALPHABET_AUTOMATIC_SHIFTED: return "ALPHABET_AUTOMATIC_SHIFTED";
|
case MockConstants.ALPHABET_AUTOMATIC_SHIFTED: return "ALPHABET_AUTOMATIC_SHIFTED";
|
||||||
case MockConstants.ALPHABET_SHIFT_LOCKED: return "ALPHABET_SHIFT_LOCKED";
|
case MockConstants.ALPHABET_SHIFT_LOCKED: return "ALPHABET_SHIFT_LOCKED";
|
||||||
case MockConstants.ALPHABET_SHIFT_LOCK_SHIFTED: return "ALPHABET_SHIFT_LOCK_SHIFTED";
|
case MockConstants.ALPHABET_SHIFT_LOCK_SHIFTED: return "ALPHABET_SHIFT_LOCK_SHIFTED";
|
||||||
case MockConstants.SYMBOLS_UNSHIFTED: return "SYMBOLS_UNSHIFTED";
|
case MockConstants.SYMBOLS: return "SYMBOLS";
|
||||||
case MockConstants.SYMBOLS_SHIFTED: return "SYMBOLS_SHIFTED";
|
|
||||||
default: return "UNKNOWN<" + layoutId + ">";
|
default: return "UNKNOWN<" + layoutId + ">";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,12 +109,7 @@ public class MockKeyboardSwitcher implements KeyboardState.SwitchActions {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSymbolsKeyboard() {
|
public void setSymbolsKeyboard() {
|
||||||
mLayout = MockConstants.SYMBOLS_UNSHIFTED;
|
mLayout = MockConstants.SYMBOLS;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setSymbolsShiftedKeyboard() {
|
|
||||||
mLayout = MockConstants.SYMBOLS_SHIFTED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue