am 2959fc0f: Delay shift lock transient until long pressed shift key is released
* commit '2959fc0f13ec29e05eda2c4a1e9a728350a80557': Delay shift lock transient until long pressed shift key is releasedmain
commit
c79a710445
|
@ -85,6 +85,9 @@ public class KeyboardState {
|
||||||
private boolean mPrevMainKeyboardWasShiftLocked;
|
private boolean mPrevMainKeyboardWasShiftLocked;
|
||||||
private boolean mPrevSymbolsKeyboardWasShifted;
|
private boolean mPrevSymbolsKeyboardWasShifted;
|
||||||
|
|
||||||
|
// For handling long press.
|
||||||
|
private boolean mLongPressShiftLockFired;
|
||||||
|
|
||||||
// For handling double tap.
|
// For handling double tap.
|
||||||
private boolean mIsInAlphabetUnshiftedFromShifted;
|
private boolean mIsInAlphabetUnshiftedFromShifted;
|
||||||
private boolean mIsInDoubleTapShiftKey;
|
private boolean mIsInDoubleTapShiftKey;
|
||||||
|
@ -312,6 +315,7 @@ public class KeyboardState {
|
||||||
} else {
|
} else {
|
||||||
mSwitchActions.cancelDoubleTapTimer();
|
mSwitchActions.cancelDoubleTapTimer();
|
||||||
mSwitchActions.cancelLongPressTimer();
|
mSwitchActions.cancelLongPressTimer();
|
||||||
|
mLongPressShiftLockFired = false;
|
||||||
mShiftKeyState.onOtherKeyPressed();
|
mShiftKeyState.onOtherKeyPressed();
|
||||||
mSymbolKeyState.onOtherKeyPressed();
|
mSymbolKeyState.onOtherKeyPressed();
|
||||||
// It is required to reset the auto caps state when all of the following conditions
|
// It is required to reset the auto caps state when all of the following conditions
|
||||||
|
@ -375,15 +379,7 @@ public class KeyboardState {
|
||||||
ResearchLogger.keyboardState_onLongPressTimeout(code, this);
|
ResearchLogger.keyboardState_onLongPressTimeout(code, this);
|
||||||
}
|
}
|
||||||
if (mIsAlphabetMode && code == Keyboard.CODE_SHIFT) {
|
if (mIsAlphabetMode && code == Keyboard.CODE_SHIFT) {
|
||||||
if (mAlphabetShiftState.isShiftLocked()) {
|
mLongPressShiftLockFired = true;
|
||||||
setShiftLocked(false);
|
|
||||||
// Shift key is long pressed while shift locked state, we will toggle back to normal
|
|
||||||
// state. And mark as if shift key is released.
|
|
||||||
mShiftKeyState.onRelease();
|
|
||||||
} else {
|
|
||||||
// Shift key is long pressed while shift unlocked state.
|
|
||||||
setShiftLocked(true);
|
|
||||||
}
|
|
||||||
mSwitchActions.hapticAndAudioFeedback(code);
|
mSwitchActions.hapticAndAudioFeedback(code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -413,6 +409,7 @@ public class KeyboardState {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onPressShift() {
|
private void onPressShift() {
|
||||||
|
mLongPressShiftLockFired = false;
|
||||||
if (mIsAlphabetMode) {
|
if (mIsAlphabetMode) {
|
||||||
mIsInDoubleTapShiftKey = mSwitchActions.isInDoubleTapTimeout();
|
mIsInDoubleTapShiftKey = mSwitchActions.isInDoubleTapTimeout();
|
||||||
if (!mIsInDoubleTapShiftKey) {
|
if (!mIsInDoubleTapShiftKey) {
|
||||||
|
@ -466,6 +463,8 @@ public class KeyboardState {
|
||||||
// Double tap shift key has been handled in {@link #onPressShift}, so that just
|
// Double tap shift key has been handled in {@link #onPressShift}, so that just
|
||||||
// ignore this release shift key here.
|
// ignore this release shift key here.
|
||||||
mIsInDoubleTapShiftKey = false;
|
mIsInDoubleTapShiftKey = false;
|
||||||
|
} else if (mLongPressShiftLockFired) {
|
||||||
|
setShiftLocked(!mAlphabetShiftState.isShiftLocked());
|
||||||
} else if (mShiftKeyState.isChording()) {
|
} else if (mShiftKeyState.isChording()) {
|
||||||
if (mAlphabetShiftState.isShiftLockShifted()) {
|
if (mAlphabetShiftState.isShiftLockShifted()) {
|
||||||
// After chording input while shift locked state.
|
// After chording input while shift locked state.
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
// Chording input in shift locked.
|
// Chording input in shift locked.
|
||||||
public void testChordingShiftLocked() {
|
public void testChordingShiftLocked() {
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
|
|
||||||
// Press shift key and hold, enter into choring shift state.
|
// Press shift key and hold, enter into choring shift state.
|
||||||
|
@ -116,7 +116,7 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
// Load keyboard
|
// Load keyboard
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||||
|
@ -134,7 +134,7 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
// Load keyboard
|
// Load keyboard
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||||
|
@ -193,7 +193,7 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
// Load keyboard
|
// Load keyboard
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||||
|
@ -213,7 +213,7 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
// Load keyboard
|
// Load keyboard
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||||
|
@ -377,45 +377,44 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testLongPressShiftAndChording() {
|
public void testLongPressShiftAndChording() {
|
||||||
// TODO: The following tests fail due to bug. Temporarily commented.
|
// Long press shift key, enter maybe shift locked.
|
||||||
// // Long press shift key, enter maybe shift locked.
|
longPressKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
// longPressKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
// Press/release letter key, remain in manual shifted.
|
||||||
// // Press/release letter key, remain in manual shifted.
|
chordingPressAndReleaseKey('A', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
// chordingPressAndReleaseKey('A', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
// Release shift key, back to alphabet (not shift locked).
|
||||||
// // Release shift key, back to alphabet (not shift locked).
|
releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED);
|
||||||
// releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED);
|
|
||||||
//
|
// Long press shift key, enter alphabet shift locked.
|
||||||
// // Long press shift key, enter alphabet shift locked.
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
// longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// ALPHABET_SHIFT_LOCKED);
|
// Long press shift key, enter maybe alphabet.
|
||||||
// // Long press shift key, enter maybe alphabet.
|
longPressKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED);
|
||||||
// longPressKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED);
|
// Press/release letter key, remain in manual shifted.
|
||||||
// // Press/release letter key, remain in manual shifted.
|
chordingPressAndReleaseKey('A', ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED);
|
||||||
// chordingPressAndReleaseKey('A', ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED);
|
// Release shift key, back to shift locked (not alphabet).
|
||||||
// // Release shift key, back to shift locked (not alphabet).
|
releaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCKED);
|
||||||
// releaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCKED);
|
// Long press shift key, enter alphabet
|
||||||
// // Long press shift key, enter alphabet
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED,
|
||||||
// longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED,
|
ALPHABET_UNSHIFTED);
|
||||||
// ALPHABET_UNSHIFTED);
|
|
||||||
//
|
// 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);
|
// Long press shift key, enter maybe alphabet.
|
||||||
// // Long press shift key, enter maybe alphabet.
|
longPressKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
// longPressKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
// Press/release letter key, remain in manual shifted.
|
||||||
// // Press/release letter key, remain in manual shifted.
|
chordingPressAndReleaseKey('A', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
// chordingPressAndReleaseKey('A', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
// Release shift key, back to alphabet shifted (not alphabet).
|
||||||
// // Release shift key, back to alphabet shifted (not alphabet).
|
releaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED);
|
||||||
// releaseKey(CODE_SHIFT, ALPHABET_MANUAL_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);
|
// Load keyboard, should be in automatic shifted.
|
||||||
// // Load keyboard, should be in automatic shifted.
|
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
||||||
// loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
// Long press shift key, enter maybe shift locked.
|
||||||
// // Long press shift key, enter maybe shift locked.
|
longPressKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
// longPressKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
// Press/release letter key, remain in manual shifted.
|
||||||
// // Press/release letter key, remain in manual shifted.
|
chordingPressAndReleaseKey('A', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
||||||
// chordingPressAndReleaseKey('A', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
|
// Release shift key, back to alphabet (not shift locked).
|
||||||
// // Release shift key, back to alphabet (not shift locked).
|
releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED);
|
||||||
// releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Switching between alphabet shift locked and symbols.
|
// Switching between alphabet shift locked and symbols.
|
||||||
public void testAlphabetShiftLockedAndSymbols() {
|
public void testAlphabetShiftLockedAndSymbols() {
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, 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.
|
||||||
|
@ -130,7 +130,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Automatic switch back to alphabet shift locked test by space key.
|
// Automatic switch back to alphabet shift locked test by space key.
|
||||||
public void testSwitchBackBySpaceShiftLocked() {
|
public void testSwitchBackBySpaceShiftLocked() {
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, 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.
|
||||||
|
@ -183,7 +183,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
setLayoutSwitchBackSymbols(switchBackSymbols);
|
setLayoutSwitchBackSymbols(switchBackSymbols);
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, 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.
|
||||||
|
@ -246,13 +246,13 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Load keyboard, should be in alphabet.
|
// Load keyboard, should be in alphabet.
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release shift key, back to alphabet.
|
// Press/release shift key, back to alphabet.
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release letter key, remain in shift locked.
|
// Press/release letter key, remain in shift locked.
|
||||||
pressAndReleaseKey('A', ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
pressAndReleaseKey('A', ALPHABET_SHIFT_LOCKED, ALPHABET_SHIFT_LOCKED);
|
||||||
|
@ -262,16 +262,16 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Long press shift key, back to alphabet.
|
// Long press shift key, back to alphabet.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED,
|
||||||
ALPHABET_UNSHIFTED);
|
ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// 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);
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release shift key, back to alphabet.
|
// Press/release shift key, back to alphabet.
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
@ -281,7 +281,7 @@ 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);
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release shift key, back to alphabet.
|
// Press/release shift key, back to alphabet.
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
@ -343,12 +343,12 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
updateShiftState(ALPHABET_UNSHIFTED);
|
updateShiftState(ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Update shift state, remained in alphabet shift locked.
|
// Update shift state, remained in alphabet shift locked.
|
||||||
updateShiftState(ALPHABET_SHIFT_LOCKED);
|
updateShiftState(ALPHABET_SHIFT_LOCKED);
|
||||||
// Long press shift key, back to alphabet.
|
// Long press shift key, back to alphabet.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED,
|
||||||
ALPHABET_UNSHIFTED);
|
ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
|
@ -376,12 +376,12 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
updateShiftState(ALPHABET_AUTOMATIC_SHIFTED);
|
updateShiftState(ALPHABET_AUTOMATIC_SHIFTED);
|
||||||
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Update shift state, remained in alphabet shift locked (not automatic shifted).
|
// Update shift state, remained in alphabet shift locked (not automatic shifted).
|
||||||
updateShiftState(ALPHABET_SHIFT_LOCKED);
|
updateShiftState(ALPHABET_SHIFT_LOCKED);
|
||||||
// Long press shift key, back to alphabet.
|
// Long press shift key, back to alphabet.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_SHIFT_LOCK_SHIFTED,
|
||||||
ALPHABET_UNSHIFTED);
|
ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Load keyboard, should be in automatic shifted.
|
// Load keyboard, should be in automatic shifted.
|
||||||
|
@ -429,7 +429,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
|
|
||||||
// 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.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press and slide from "123?" key, enter symbols.
|
// Press and slide from "123?" key, enter symbols.
|
||||||
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndSlideFromKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||||
|
@ -481,7 +481,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Load keyboard
|
// Load keyboard
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||||
|
@ -497,7 +497,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Load keyboard
|
// Load keyboard
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||||
|
@ -551,7 +551,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Load keyboard
|
// Load keyboard
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||||
|
@ -569,7 +569,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
// Load keyboard
|
// Load keyboard
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release "?123" key, enter into symbols.
|
// Press/release "?123" key, enter into symbols.
|
||||||
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
pressAndReleaseKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
|
||||||
|
@ -591,7 +591,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Change focus to new text field.
|
// Change focus to new text field.
|
||||||
loadKeyboard(ALPHABET_UNSHIFTED);
|
loadKeyboard(ALPHABET_UNSHIFTED);
|
||||||
|
@ -622,7 +622,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
||||||
|
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Change focus to new text field.
|
// Change focus to new text field.
|
||||||
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
loadKeyboard(ALPHABET_AUTOMATIC_SHIFTED);
|
||||||
|
@ -655,7 +655,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
|
|
||||||
// Alphabet shift locked -> rotate -> alphabet shift locked.
|
// Alphabet shift locked -> rotate -> alphabet shift locked.
|
||||||
// Long press shift key, enter alphabet shift locked.
|
// Long press shift key, enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Rotate device, remain in alphabet shift locked.
|
// Rotate device, remain in alphabet shift locked.
|
||||||
rotateDevice(ALPHABET_SHIFT_LOCKED);
|
rotateDevice(ALPHABET_SHIFT_LOCKED);
|
||||||
|
@ -739,7 +739,7 @@ public class KeyboardStateSingleTouchTests extends KeyboardStateTestsBase {
|
||||||
secondPressAndReleaseKey('J', ALPHABET_MANUAL_SHIFTED, ALPHABET_UNSHIFTED);
|
secondPressAndReleaseKey('J', ALPHABET_MANUAL_SHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
|
||||||
// Long press shift key to enter alphabet shift locked.
|
// Long press shift key to enter alphabet shift locked.
|
||||||
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_SHIFT_LOCKED,
|
longPressAndReleaseKey(CODE_SHIFT, ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED,
|
||||||
ALPHABET_SHIFT_LOCKED);
|
ALPHABET_SHIFT_LOCKED);
|
||||||
// Press/release shift key
|
// Press/release shift key
|
||||||
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
pressAndReleaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCK_SHIFTED, ALPHABET_UNSHIFTED);
|
||||||
|
|
Loading…
Reference in New Issue