am 085b6594: Merge "Fix KeyboardState to pass KeyboardStateMultiTouchTests"

* commit '085b659463c41beb01950bf82334f451cca8ed2e':
  Fix KeyboardState to pass KeyboardStateMultiTouchTests
main
Tadashi G. Takaoka 2012-01-19 02:15:28 -08:00 committed by Android Git Automerger
commit 33b1944f92
2 changed files with 16 additions and 15 deletions

View File

@ -338,7 +338,11 @@ public class KeyboardState {
final boolean isShiftLocked = mAlphabetShiftState.isShiftLocked();
if (mShiftKeyState.isMomentary()) {
// After chording input while normal state.
setShifted(SwitchActions.UNSHIFT);
if (mAlphabetShiftState.isShiftLockShifted()) {
setShiftLocked(true);
} else {
setShifted(SwitchActions.UNSHIFT);
}
} else if (isShiftLocked && !mAlphabetShiftState.isShiftLockShifted()
&& (mShiftKeyState.isPressing() || mShiftKeyState.isPressingOnShifted())
&& !withSliding) {

View File

@ -52,21 +52,18 @@ public class KeyboardStateMultiTouchTests extends KeyboardStateTestsBase {
chordingPressAndReleaseKey('Z', 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.
// releaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCKED);
releaseKey(CODE_SHIFT, ALPHABET_UNSHIFTED);
// Release shift key, switch back to alphabet shift locked.
releaseKey(CODE_SHIFT, ALPHABET_SHIFT_LOCKED);
// TODO: This test fails due to bug, though external behavior is correct.
// // Press symbols key and hold, enter into choring symbols state.
// pressKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
//
// // Press/release symbol letter keys.
// chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// chordingPressAndReleaseKey('2', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
//
// // Release symbols key, switch back to alphabet shift locked.
// releaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED);
// Press symbols key and hold, enter into choring symbols state.
pressKey(CODE_SYMBOL, SYMBOLS_UNSHIFTED);
// Press/release symbol letter keys.
chordingPressAndReleaseKey('1', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
chordingPressAndReleaseKey('2', SYMBOLS_UNSHIFTED, SYMBOLS_UNSHIFTED);
// Release symbols key, switch back to alphabet shift locked.
releaseKey(CODE_SYMBOL, ALPHABET_SHIFT_LOCKED);
}
// Symbols key chording input.