Skip to content
Snippets Groups Projects
Commit d26d63b3 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Fix KeyboardState to pass KeyboardStateMultiTouchTests

Change-Id: If2b9ee7cf3fad7633d64b98758f802792d66f7a8
parent 01d9fc96
No related branches found
No related tags found
No related merge requests found
...@@ -338,7 +338,11 @@ public class KeyboardState { ...@@ -338,7 +338,11 @@ public class KeyboardState {
final boolean isShiftLocked = mAlphabetShiftState.isShiftLocked(); final boolean isShiftLocked = mAlphabetShiftState.isShiftLocked();
if (mShiftKeyState.isMomentary()) { if (mShiftKeyState.isMomentary()) {
// After chording input while normal state. // After chording input while normal state.
setShifted(SwitchActions.UNSHIFT); if (mAlphabetShiftState.isShiftLockShifted()) {
setShiftLocked(true);
} else {
setShifted(SwitchActions.UNSHIFT);
}
} else if (isShiftLocked && !mAlphabetShiftState.isShiftLockShifted() } else if (isShiftLocked && !mAlphabetShiftState.isShiftLockShifted()
&& (mShiftKeyState.isPressing() || mShiftKeyState.isPressingOnShifted()) && (mShiftKeyState.isPressing() || mShiftKeyState.isPressingOnShifted())
&& !withSliding) { && !withSliding) {
......
...@@ -52,21 +52,18 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase { ...@@ -52,21 +52,18 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
chordingPressAndReleaseKey('Z', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); chordingPressAndReleaseKey('Z', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
chordingPressAndReleaseKey('X', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED); chordingPressAndReleaseKey('X', ALPHABET_MANUAL_SHIFTED, ALPHABET_MANUAL_SHIFTED);
// TODO: This test fails due to bug, though external behavior is correct. // Release shift key, switch back to alphabet shift locked.
// // Release shift key, switch back to alphabet shift locked. releaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCKED);
// releaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCKED);
releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED);
// TODO: This test fails due to bug, though external behavior is correct. // Press symbols key and hold, enter into choring symbols state.
// // Press symbols key and hold, enter into choring symbols state. pressKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
// pressKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
// // Press/release symbol letter keys.
// // Press/release symbol letter keys. chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED); chordingPressAndReleaseKey('2', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// chordingPressAndReleaseKey('2', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// // Release symbols key, switch back to alphabet shift locked.
// // Release symbols key, switch back to alphabet shift locked. releaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED);
// releaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED);
} }
// Symbols key chording input. // Symbols key chording input.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment