diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index a96cfec1e..3512686d0 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -370,7 +370,6 @@
-
@@ -425,7 +424,6 @@
-
diff --git a/java/res/xml-sw600dp/keys_pcqwerty2_right3.xml b/java/res/xml-sw600dp/keys_pcqwerty2_right3.xml
index 0a27ca70c..1db6c350f 100644
--- a/java/res/xml-sw600dp/keys_pcqwerty2_right3.xml
+++ b/java/res/xml-sw600dp/keys_pcqwerty2_right3.xml
@@ -23,7 +23,7 @@
>
+
diff --git a/java/res/xml/rowkeys_pcqwerty2.xml b/java/res/xml/rowkeys_pcqwerty2.xml
index cedf47559..2dfb653b2 100644
--- a/java/res/xml/rowkeys_pcqwerty2.xml
+++ b/java/res/xml/rowkeys_pcqwerty2.xml
@@ -23,7 +23,7 @@
>
diff --git a/java/res/xml/rowkeys_pcqwerty3.xml b/java/res/xml/rowkeys_pcqwerty3.xml
index 5044e5feb..eca336264 100644
--- a/java/res/xml/rowkeys_pcqwerty3.xml
+++ b/java/res/xml/rowkeys_pcqwerty3.xml
@@ -23,7 +23,7 @@
>
diff --git a/java/res/xml/rowkeys_pcqwerty4.xml b/java/res/xml/rowkeys_pcqwerty4.xml
index 4071e8c09..f00baeb6f 100644
--- a/java/res/xml/rowkeys_pcqwerty4.xml
+++ b/java/res/xml/rowkeys_pcqwerty4.xml
@@ -23,7 +23,7 @@
>
diff --git a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
index 73896dfd3..b3bb767af 100644
--- a/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
+++ b/java/src/com/android/inputmethod/accessibility/AccessibleKeyboardViewProxy.java
@@ -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:
diff --git a/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java b/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
index 58624a2e6..085ca93d5 100644
--- a/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
+++ b/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java
@@ -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:
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
index 2a09c6710..08ce064e0 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
@@ -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";
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 1ea0f8b96..4313467cb 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -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() {
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
index 6b02942ce..0b10a1d1a 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
@@ -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) {
@@ -155,11 +146,7 @@ public final class KeyboardState {
if (!state.mIsValid || state.mIsAlphabetMode) {
setAlphabetKeyboard();
} else {
- if (state.mShiftMode == MANUAL_SHIFT) {
- setSymbolsShiftedKeyboard();
- } else {
- setSymbolsKeyboard();
- }
+ setSymbolsKeyboard();
}
if (!state.mIsValid) return;
@@ -235,14 +222,8 @@ public final class KeyboardState {
}
if (mIsAlphabetMode) {
mPrevMainKeyboardWasShiftLocked = mAlphabetShiftState.isShiftLocked();
- if (mPrevSymbolsKeyboardWasShifted) {
- setSymbolsShiftedKeyboard();
- } else {
- setSymbolsKeyboard();
- }
- mPrevSymbolsKeyboardWasShifted = false;
+ setSymbolsKeyboard();
} 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,47 +397,43 @@ public final class KeyboardState {
if (RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE != mRecapitalizeMode) {
return;
}
- if (mIsAlphabetMode) {
- mIsInDoubleTapShiftKey = mSwitchActions.isInDoubleTapShiftKeyTimeout();
- if (!mIsInDoubleTapShiftKey) {
- // This is first tap.
- mSwitchActions.startDoubleTapShiftKeyTimer();
- }
- if (mIsInDoubleTapShiftKey) {
- if (mAlphabetShiftState.isManualShifted() || mIsInAlphabetUnshiftedFromShifted) {
- // Shift key has been double tapped while in manual shifted or automatic
- // shifted state.
- setShiftLocked(true);
- } else {
- // Shift key has been double tapped while in normal state. This is the second
- // tap to disable shift locked state, so just ignore this.
- }
+ if (!mIsAlphabetMode) {
+ // There is no shift key on symbols keyboard.
+ return;
+ }
+ mIsInDoubleTapShiftKey = mSwitchActions.isInDoubleTapShiftKeyTimeout();
+ if (!mIsInDoubleTapShiftKey) {
+ // This is first tap.
+ mSwitchActions.startDoubleTapShiftKeyTimer();
+ }
+ if (mIsInDoubleTapShiftKey) {
+ if (mAlphabetShiftState.isManualShifted() || mIsInAlphabetUnshiftedFromShifted) {
+ // Shift key has been double tapped while in manual shifted or automatic
+ // shifted state.
+ setShiftLocked(true);
} else {
- if (mAlphabetShiftState.isShiftLocked()) {
- // 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();
- }
+ // Shift key has been double tapped while in normal state. This is the second
+ // tap to disable shift locked state, so just ignore this.
}
} else {
- // In symbol mode, just toggle symbol and symbol more keyboard.
- toggleShiftInSymbols();
- mSwitchState = SWITCH_STATE_MOMENTARY_SYMBOL_AND_MORE;
- mShiftKeyState.onPress();
+ if (mAlphabetShiftState.isShiftLocked()) {
+ // 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();
+ }
}
}
@@ -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) + "]";
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateMultiTouchTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateMultiTouchTests.java
index 9ad81c01d..be1ecf787 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateMultiTouchTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateMultiTouchTests.java
@@ -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);
}
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateSingleTouchTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateSingleTouchTests.java
index c7ac76d93..611482bcf 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateSingleTouchTests.java
+++ b/tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateSingleTouchTests.java
@@ -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.
diff --git a/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java b/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java
index db3997651..682d8fc63 100644
--- a/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java
+++ b/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java
@@ -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