am e3150664: Revert "Remove symbols shifted layout related code"

* commit 'e3150664ae4d8d007b8571b5bd0fd2259aac3a20':
  Revert "Remove symbols shifted layout related code"
main
Satoshi Kataoka 2013-09-04 00:31:03 -07:00 committed by Android Git Automerger
commit 183570bbee
9 changed files with 646 additions and 108 deletions

View File

@ -388,6 +388,7 @@
<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" />
@ -449,6 +450,7 @@
<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" />

View File

@ -357,6 +357,7 @@ 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:
@ -388,6 +389,7 @@ 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:

View File

@ -156,6 +156,7 @@ 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:
@ -190,6 +191,7 @@ 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:

View File

@ -50,6 +50,7 @@ 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;
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;
@ -219,6 +220,7 @@ 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";

View File

@ -269,6 +269,12 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
mEmojiKeyboardView.setVisibility(View.VISIBLE); mEmojiKeyboardView.setVisibility(View.VISIBLE);
} }
// 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() {

View File

@ -47,6 +47,7 @@ public final class KeyboardState {
public void setAlphabetShiftLockShiftedKeyboard(); public void setAlphabetShiftLockShiftedKeyboard();
public void setSymbolsKeyboard(); public void setSymbolsKeyboard();
public void setEmojiKeyboard(); public void setEmojiKeyboard();
public void setSymbolsShiftedKeyboard();
/** /**
* Request to call back {@link KeyboardState#onUpdateShiftState(int, int)}. * Request to call back {@link KeyboardState#onUpdateShiftState(int, int)}.
@ -64,11 +65,13 @@ 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 #mPrevMainKeyboardWasShiftLocked} into single state variable. // {@link #mIsSymbolShifted}, {@link #mPrevMainKeyboardWasShiftLocked}, and
// {@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;
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;
@ -77,7 +80,9 @@ public final class KeyboardState {
private boolean mIsAlphabetMode; private boolean mIsAlphabetMode;
private boolean mIsEmojiMode; private boolean mIsEmojiMode;
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 +107,7 @@ public final class KeyboardState {
} else if (mIsEmojiMode) { } else if (mIsEmojiMode) {
return "EMOJI"; return "EMOJI";
} else { } else {
return "SYMBOLS"; return "SYMBOLS_" + shiftModeToString(mShiftMode);
} }
} }
} }
@ -119,6 +124,7 @@ 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,6 +145,7 @@ 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) {
@ -156,7 +163,11 @@ public final class KeyboardState {
} else if (state.mIsEmojiMode) { } else if (state.mIsEmojiMode) {
setEmojiKeyboard(); setEmojiKeyboard();
} else { } else {
setSymbolsKeyboard(); if (state.mShiftMode == MANUAL_SHIFT) {
setSymbolsShiftedKeyboard();
} else {
setSymbolsKeyboard();
}
} }
if (!state.mIsValid) return; if (!state.mIsValid) return;
@ -232,8 +243,14 @@ public final class KeyboardState {
} }
if (mIsAlphabetMode) { if (mIsAlphabetMode) {
mPrevMainKeyboardWasShiftLocked = mAlphabetShiftState.isShiftLocked(); mPrevMainKeyboardWasShiftLocked = mAlphabetShiftState.isShiftLocked();
setSymbolsKeyboard(); if (mPrevSymbolsKeyboardWasShifted) {
setSymbolsShiftedKeyboard();
} else {
setSymbolsKeyboard();
}
mPrevSymbolsKeyboardWasShifted = false;
} else { } else {
mPrevSymbolsKeyboardWasShifted = mIsSymbolShifted;
setAlphabetKeyboard(); setAlphabetKeyboard();
if (mPrevMainKeyboardWasShiftLocked) { if (mPrevMainKeyboardWasShiftLocked) {
setShiftLocked(true); setShiftLocked(true);
@ -250,6 +267,7 @@ public final class KeyboardState {
} }
if (mIsAlphabetMode) return; if (mIsAlphabetMode) return;
mPrevSymbolsKeyboardWasShifted = mIsSymbolShifted;
setAlphabetKeyboard(); setAlphabetKeyboard();
if (mPrevMainKeyboardWasShiftLocked) { if (mPrevMainKeyboardWasShiftLocked) {
setShiftLocked(true); setShiftLocked(true);
@ -257,6 +275,14 @@ 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");
@ -265,6 +291,7 @@ public final class KeyboardState {
mSwitchActions.setAlphabetKeyboard(); mSwitchActions.setAlphabetKeyboard();
mIsAlphabetMode = true; mIsAlphabetMode = true;
mIsEmojiMode = false; mIsEmojiMode = false;
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();
@ -276,6 +303,19 @@ 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;
@ -337,7 +377,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(); onReleaseSymbol(withSliding);
} }
} }
@ -347,11 +387,16 @@ public final class KeyboardState {
mSwitchState = SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL; mSwitchState = SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL;
} }
private void onReleaseSymbol() { private void onReleaseSymbol(final boolean withSliding) {
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();
} }
@ -417,43 +462,48 @@ public final class KeyboardState {
if (RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE != mRecapitalizeMode) { if (RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE != mRecapitalizeMode) {
return; return;
} }
if (!mIsAlphabetMode) { if (mIsAlphabetMode) {
// There is no shift key on symbols keyboard. mIsInDoubleTapShiftKey = mSwitchActions.isInDoubleTapShiftKeyTimeout();
return; if (!mIsInDoubleTapShiftKey) {
} // This is first tap.
mIsInDoubleTapShiftKey = mSwitchActions.isInDoubleTapShiftKeyTimeout(); mSwitchActions.startDoubleTapShiftKeyTimer();
if (!mIsInDoubleTapShiftKey) { }
// This is first tap. if (mIsInDoubleTapShiftKey) {
mSwitchActions.startDoubleTapShiftKeyTimer(); if (mAlphabetShiftState.isManualShifted() || mIsInAlphabetUnshiftedFromShifted) {
} // Shift key has been double tapped while in manual shifted or automatic
if (mIsInDoubleTapShiftKey) { // shifted state.
if (mAlphabetShiftState.isManualShifted() || mIsInAlphabetUnshiftedFromShifted) { setShiftLocked(true);
// Shift key has been double tapped while in manual shifted or automatic } else {
// shifted state. // Shift key has been double tapped while in normal state. This is the second
setShiftLocked(true); // tap to disable shift locked state, so just ignore this.
}
} else { } else {
// Shift key has been double tapped while in normal state. This is the second if (mAlphabetShiftState.isShiftLocked()) {
// tap to disable shift locked state, so just ignore this. // Shift key is pressed while shift locked state, we will treat this state as
// 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 {
if (mAlphabetShiftState.isShiftLocked()) { // In symbol mode, just toggle symbol and symbol more keyboard.
// Shift key is pressed while shift locked state, we will treat this state as toggleShiftInSymbols();
// shift lock shifted state and mark as if shift key pressed while normal state. mSwitchState = SWITCH_STATE_MOMENTARY_SYMBOL_AND_MORE;
setShifted(SHIFT_LOCK_SHIFTED); mShiftKeyState.onPress();
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();
}
} }
} }
@ -508,7 +558,11 @@ public final class KeyboardState {
mIsInAlphabetUnshiftedFromShifted = true; mIsInAlphabetUnshiftedFromShifted = true;
} }
} else { } else {
// There is no shift key on symbols keyboard. // 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();
}
} }
mShiftKeyState.onRelease(); mShiftKeyState.onRelease();
} }
@ -522,6 +576,9 @@ 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;
@ -549,6 +606,13 @@ 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)) {
@ -560,6 +624,7 @@ 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;
} }
@ -587,6 +652,7 @@ 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;
} }
@ -594,7 +660,8 @@ public final class KeyboardState {
@Override @Override
public String toString() { public String toString() {
return "[keyboard=" + (mIsAlphabetMode ? mAlphabetShiftState.toString() : "SYMBOLS") return "[keyboard=" + (mIsAlphabetMode ? mAlphabetShiftState.toString()
: (mIsSymbolShifted ? "SYMBOLS_SHIFTED" : "SYMBOLS"))
+ " shift=" + mShiftKeyState + " shift=" + mShiftKeyState
+ " symbol=" + mSymbolKeyState + " symbol=" + mSymbolKeyState
+ " switch=" + switchStateToString(mSwitchState) + "]"; + " switch=" + switchStateToString(mSwitchState) + "]";

View File

@ -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); pressKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
// Press/release symbol letter key. // Press/release symbol letter key.
chordingPressAndReleaseKey('1', SYMBOLS, SYMBOLS); chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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); pressKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
// Press/release symbol letter key. // Press/release symbol letter key.
chordingPressAndReleaseKey('1', SYMBOLS, SYMBOLS); chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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); pressKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
// Press/release symbol letter key. // Press/release symbol letter key.
chordingPressAndReleaseKey('1', SYMBOLS, SYMBOLS); chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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,14 +81,21 @@ 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, 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);
// 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); releaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
// Alphabet shifted -> symbols -> "ABC" key + letter -> symbols // Alphabet shifted -> symbols -> "ABC" key + letter -> symbols
// -> alphabet. // -> alphabet.
@ -97,13 +104,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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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); releaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
// 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);
@ -115,13 +122,112 @@ 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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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); 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);
// 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);
} }
@ -143,9 +249,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); pressKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
// Press/release symbol letter key. // Press/release symbol letter key.
chordingPressAndReleaseKey('1', SYMBOLS, SYMBOLS); chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Release "123?" key, switch back to alphabet. // Release "123?" key, switch back to alphabet.
releaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED); releaseKey(CODE_SYMBOL, ALPHABET_UNSHIFTED);
} }

View File

@ -34,14 +34,38 @@ 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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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, 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);
} }
// Switching between alphabet shifted and symbols. // Switching between alphabet shifted and symbols.
@ -50,7 +74,16 @@ 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, 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);
// 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);
} }
@ -62,21 +95,39 @@ 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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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, 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);
} }
// 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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Enter symbol letter. // Enter symbol letter.
pressAndReleaseKey('1', SYMBOLS, SYMBOLS); pressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Enter space, switch back to alphabet. // Enter space, switch back to alphabet.
pressAndReleaseKey(CODE_SPACE, SYMBOLS, ALPHABET_UNSHIFTED); 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);
} }
// Automatic switch back to alphabet shift locked test by space key. // Automatic switch back to alphabet shift locked test by space key.
@ -86,11 +137,20 @@ 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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Enter symbol letter. // Enter symbol letter.
pressAndReleaseKey('1', SYMBOLS, SYMBOLS); pressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Enter space, switch back to alphabet shift locked. // Enter space, switch back to alphabet shift locked.
pressAndReleaseKey(CODE_SPACE, SYMBOLS, 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);
} }
// Automatic upper case test // Automatic upper case test
@ -113,11 +173,20 @@ 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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Press/release symbol letter key, remain in symbols. // Press/release symbol letter key, remain in symbols.
pressAndReleaseKey('1', SYMBOLS, SYMBOLS); pressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Press/release space, switch back to automatic shifted. // Press/release space, switch back to automatic shifted.
pressAndReleaseKey(CODE_SPACE, SYMBOLS, ALPHABET_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);
} }
// Long press shift key. // Long press shift key.
@ -233,9 +302,14 @@ 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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Update shift state, remained in symbols. // Update shift state, remained in symbols.
updateShiftState(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);
// 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);
@ -263,9 +337,14 @@ 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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Update shift state, remained in symbols. // Update shift state, remained in symbols.
updateShiftState(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);
} }
// Sliding input in alphabet. // Sliding input in alphabet.
@ -279,10 +358,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, SYMBOLS); pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Enter/release into symbol letter keys, switch back to alphabet. // Enter/release into symbol letter keys, switch back to alphabet.
pressAndSlideFromKey('@', SYMBOLS, SYMBOLS); pressAndSlideFromKey('@', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
stopSlidingOnKey('!', SYMBOLS, ALPHABET_UNSHIFTED); stopSlidingOnKey('!', SYMBOLS_UNSHIFTED, 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.
@ -297,20 +376,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, SYMBOLS); pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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, SYMBOLS); pressAndSlideFromKey('@', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
stopSlidingOnKey('!', SYMBOLS, ALPHABET_UNSHIFTED); stopSlidingOnKey('!', SYMBOLS_UNSHIFTED, 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, SYMBOLS); pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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, SYMBOLS); pressAndSlideFromKey('!', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
stopSlidingOnKey('!', SYMBOLS, ALPHABET_SHIFT_LOCKED); stopSlidingOnKey('!', SYMBOLS_UNSHIFTED, 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.
@ -334,9 +413,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, SYMBOLS); pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Enter/release into symbol letter key, remains in symbols. // Enter/release into symbol letter key, remains in symbols.
pressAndSlideFromKey('!', SYMBOLS, SYMBOLS); pressAndSlideFromKey('!', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Cancel sliding, switch back to alphabet. // Cancel sliding, switch back to alphabet.
stopSlidingAndCancel(ALPHABET_UNSHIFTED); stopSlidingAndCancel(ALPHABET_UNSHIFTED);
@ -354,9 +433,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, SYMBOLS); pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Enter/release into symbol letter key, remains in symbols. // Enter/release into symbol letter key, remains in symbols.
pressAndSlideFromKey('!', SYMBOLS, SYMBOLS); pressAndSlideFromKey('!', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Cancel sliding, switch back to alphabet (not alphabet shifted). // Cancel sliding, switch back to alphabet (not alphabet shifted).
stopSlidingAndCancel(ALPHABET_UNSHIFTED); stopSlidingAndCancel(ALPHABET_UNSHIFTED);
@ -365,9 +444,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, SYMBOLS); pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Enter/release into symbol letter key, remains in symbols. // Enter/release into symbol letter key, remains in symbols.
pressAndSlideFromKey('!', SYMBOLS, SYMBOLS); pressAndSlideFromKey('!', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Cancel sliding, switch back to alphabet shift locked. // Cancel sliding, switch back to alphabet shift locked.
stopSlidingAndCancel( ALPHABET_SHIFT_LOCKED); stopSlidingAndCancel( ALPHABET_SHIFT_LOCKED);
@ -382,14 +461,21 @@ 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, 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);
// 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); stopSlidingOnKey('a', ALPHABET_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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);
@ -400,12 +486,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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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); stopSlidingOnKey('a', ALPHABET_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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);
@ -417,27 +503,52 @@ 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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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); 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);
// 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, 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);
// 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); stopSlidingAndCancel(SYMBOLS_UNSHIFTED);
// 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);
@ -448,13 +559,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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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); stopSlidingAndCancel(SYMBOLS_UNSHIFTED);
// 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);
@ -466,13 +577,194 @@ 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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// 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); 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);
// 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);
} }
@ -491,7 +783,14 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
loadKeyboard(ALPHABET_UNSHIFTED); loadKeyboard(ALPHABET_UNSHIFTED);
// Press/release "?123" key. // Press/release "?123" key.
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS, SYMBOLS); 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);
// Change focus to new text field. // Change focus to new text field.
loadKeyboard(ALPHABET_UNSHIFTED); loadKeyboard(ALPHABET_UNSHIFTED);
} }
@ -515,7 +814,14 @@ 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, SYMBOLS); 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);
// Change focus to new text field. // Change focus to new text field.
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED); loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
} }
@ -554,11 +860,49 @@ 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, SYMBOLS); pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Rotate device, remain in symbols, // Rotate device, remain in symbols,
rotateDevice(SYMBOLS); rotateDevice(SYMBOLS_UNSHIFTED);
// 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.

View File

@ -43,7 +43,8 @@ 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 = 5; public static final int SYMBOLS_UNSHIFTED = 5;
public static final int SYMBOLS_SHIFTED = 6;
} }
private int mLayout = MockConstants.ALPHABET_UNSHIFTED; private int mLayout = MockConstants.ALPHABET_UNSHIFTED;
@ -68,7 +69,8 @@ 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: return "SYMBOLS"; case MockConstants.SYMBOLS_UNSHIFTED: return "SYMBOLS_UNSHIFTED";
case MockConstants.SYMBOLS_SHIFTED: return "SYMBOLS_SHIFTED";
default: return "UNKNOWN<" + layoutId + ">"; default: return "UNKNOWN<" + layoutId + ">";
} }
} }
@ -109,7 +111,12 @@ public class MockKeyboardSwitcher implements KeyboardState.SwitchActions {
@Override @Override
public void setSymbolsKeyboard() { public void setSymbolsKeyboard() {
mLayout = MockConstants.SYMBOLS; mLayout = MockConstants.SYMBOLS_UNSHIFTED;
}
@Override
public void setSymbolsShiftedKeyboard() {
mLayout = MockConstants.SYMBOLS_SHIFTED;
} }
@Override @Override