summaryrefslogtreecommitdiff
path: root/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-07-02 18:07:35 +0900
committerTadashi G. Takaoka <takaoka@google.com>2013-07-02 19:50:34 +0900
commitf87e8f7ec1efb93398d909c67468d716b0248fe7 (patch)
treeb39b0364c084541bf61d97d30b91a51998f47452 /java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
parentb6f5d3e39d1f3073c4e7d75e9d4309112879dc6e (diff)
Handling key repeat by emulating key press and code input
This change also eliminates a reference of AudioAndHapticFeedbackManager from KeyboardSwitcher and MainKeyboard. Bug: 6522943 Change-Id: Iac42ec8ff00c66deb76a660ffc07477923a58959
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java17
1 files changed, 4 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
index 370d0cb93..8ead44c31 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java
@@ -81,9 +81,6 @@ public final class KeyboardState {
private boolean mPrevSymbolsKeyboardWasShifted;
private int mRecapitalizeMode;
- // For handling long press.
- private boolean mLongPressShiftLockFired;
-
// For handling double tap.
private boolean mIsInAlphabetUnshiftedFromShifted;
private boolean mIsInDoubleTapShiftKey;
@@ -325,10 +322,11 @@ public final class KeyboardState {
}
if (code == Constants.CODE_SHIFT) {
onPressShift();
+ } else if (code == Constants.CODE_CAPSLOCK) {
+ // Nothing to do here. See {@link #onReleaseKey(int,boolean)}.
} else if (code == Constants.CODE_SWITCH_ALPHA_SYMBOL) {
onPressSymbol();
} else {
- mLongPressShiftLockFired = false;
mShiftKeyState.onOtherKeyPressed();
mSymbolKeyState.onOtherKeyPressed();
// It is required to reset the auto caps state when all of the following conditions
@@ -356,6 +354,8 @@ public final class KeyboardState {
}
if (code == Constants.CODE_SHIFT) {
onReleaseShift(withSliding);
+ } else if (code == Constants.CODE_CAPSLOCK) {
+ setShiftLocked(!mAlphabetShiftState.isShiftLocked());
} else if (code == Constants.CODE_SWITCH_ALPHA_SYMBOL) {
onReleaseSymbol(withSliding);
}
@@ -437,7 +437,6 @@ public final class KeyboardState {
}
private void onPressShift() {
- mLongPressShiftLockFired = false;
// If we are recapitalizing, we don't do any of the normal processing, including
// importantly the double tap timer.
if (RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE != mRecapitalizeMode) {
@@ -499,8 +498,6 @@ public final class KeyboardState {
// Double tap shift key has been handled in {@link #onPressShift}, so that just
// ignore this release shift key here.
mIsInDoubleTapShiftKey = false;
- } else if (mLongPressShiftLockFired) {
- setShiftLocked(!mAlphabetShiftState.isShiftLocked());
} else if (mShiftKeyState.isChording()) {
if (mAlphabetShiftState.isShiftLockShifted()) {
// After chording input while shift locked state.
@@ -610,12 +607,6 @@ public final class KeyboardState {
break;
}
- if (code == Constants.CODE_CAPSLOCK) {
- // Changing shift lock state will be handled at {@link #onPressShift()} when the shift
- // key is released.
- mLongPressShiftLockFired = true;
- }
-
// If the code is a letter, update keyboard shift state.
if (Constants.isLetterCode(code)) {
updateAlphabetShiftState(autoCaps, RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE);