diff options
author | 2012-01-18 18:01:53 +0900 | |
---|---|---|
committer | 2012-01-18 18:11:46 +0900 | |
commit | 60c4594ee6415b266b3418e46d09e6a5b3ed23e1 (patch) | |
tree | fa7773a0fd675f5a38e8ff95f49428408989dd25 /java/src | |
parent | 0f96006f77ef4f3d7450c10cffabcba6e900fb60 (diff) | |
download | latinime-60c4594ee6415b266b3418e46d09e6a5b3ed23e1.tar.gz latinime-60c4594ee6415b266b3418e46d09e6a5b3ed23e1.tar.xz latinime-60c4594ee6415b266b3418e46d09e6a5b3ed23e1.zip |
Get rid of hasDistinctMultitouch reference from KeyboardState
Change-Id: I0a783a425302fbc381d056f5b0d757c27f2a9f14
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java | 3 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java | 26 |
2 files changed, 12 insertions, 17 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index 22ab3e4e5..13a72731e 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -137,8 +137,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, mKeyboardSet = builder.build(); final KeyboardId mainKeyboardId = mKeyboardSet.getMainKeyboardId(); try { - mState.onLoadKeyboard(mResources.getString(R.string.layout_switch_back_symbols), - hasDistinctMultitouch()); + mState.onLoadKeyboard(mResources.getString(R.string.layout_switch_back_symbols)); } catch (RuntimeException e) { Log.w(TAG, "loading keyboard failed: " + mainKeyboardId, e); LatinImeLogger.logOnException(mainKeyboardId.toString(), e); diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index c43b9852b..b3d8f972c 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -26,7 +26,7 @@ import com.android.inputmethod.keyboard.Keyboard; * * This class contains all keyboard state transition logic. * - * The input events are {@link #onLoadKeyboard(String, boolean)}, {@link #onSaveKeyboardState()}, + * The input events are {@link #onLoadKeyboard(String)}, {@link #onSaveKeyboardState()}, * {@link #onPressKey(int)}, {@link #onReleaseKey(int, boolean)}, * {@link #onCodeInput(int, boolean, boolean)}, {@link #onCancelInput(boolean)}, * {@link #onUpdateShiftState(boolean)}. @@ -74,7 +74,6 @@ public class KeyboardState { private int mSwitchState = SWITCH_STATE_ALPHA; private String mLayoutSwitchBackSymbols; - private boolean mHasDistinctMultitouch; private final SwitchActions mSwitchActions; @@ -95,12 +94,11 @@ public class KeyboardState { mSwitchActions = switchActions; } - public void onLoadKeyboard(String layoutSwitchBackSymbols, boolean hasDistinctMultitouch) { + public void onLoadKeyboard(String layoutSwitchBackSymbols) { if (DEBUG_EVENT) { Log.d(TAG, "onLoadKeyboard"); } mLayoutSwitchBackSymbols = layoutSwitchBackSymbols; - mHasDistinctMultitouch = hasDistinctMultitouch; mKeyboardShiftState.setShifted(false); mKeyboardShiftState.setShiftLocked(false); mShiftKeyState.onRelease(); @@ -164,18 +162,16 @@ public class KeyboardState { if (DEBUG_ACTION) { Log.d(TAG, "setShifted: shiftMode=" + shiftModeToString(shiftMode)); } - if (shiftMode == SwitchActions.AUTOMATIC_SHIFT) { + switch (shiftMode) { + case SwitchActions.AUTOMATIC_SHIFT: mKeyboardShiftState.setAutomaticTemporaryUpperCase(); - } else { - final boolean shifted = (shiftMode == SwitchActions.MANUAL_SHIFT); - // On non-distinct multi touch panel device, we should also turn off the shift locked - // state when shift key is pressed to go to normal mode. - // On the other hand, on distinct multi touch panel device, turning off the shift - // locked state with shift key pressing is handled by onReleaseShift(). - if (!mHasDistinctMultitouch && !shifted && mKeyboardShiftState.isShiftLocked()) { - mSwitchActions.setShiftLocked(false); - } - mKeyboardShiftState.setShifted(shifted); + break; + case SwitchActions.MANUAL_SHIFT: + mKeyboardShiftState.setShifted(true); + break; + case SwitchActions.UNSHIFT: + mKeyboardShiftState.setShifted(false); + break; } mSwitchActions.setShifted(shiftMode); } |