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