diff options
Diffstat (limited to 'java/src/com')
3 files changed, 9 insertions, 53 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index af1c3eeb9..9efd65e91 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -148,7 +148,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, // have separate layouts with unique KeyboardIds for alphabet and alphabet-shifted // respectively. if (mainKeyboardId.isPhoneKeyboard()) { - mState.onToggleAlphabetAndSymbols(); + mState.setSymbolsKeyboard(); } updateShiftState(); } @@ -257,13 +257,6 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, } /** - * Toggle keyboard shift state triggered by user touch event. - */ - public void toggleShift() { - mState.onToggleShift(); - } - - /** * Toggle caps lock state triggered by user touch event. */ public void toggleCapsLock() { @@ -271,13 +264,6 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, } /** - * Toggle between alphabet and symbols modes triggered by user touch event. - */ - public void toggleAlphabetAndSymbols() { - mState.onToggleAlphabetAndSymbols(); - } - - /** * Update keyboard shift state triggered by connected EditText status change. */ public void updateShiftState() { diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index bb75111b4..a8e0bd595 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -31,8 +31,7 @@ import com.android.inputmethod.keyboard.Keyboard; * {@link #onPressShift(boolean)}, {@link #onReleaseShift(boolean)}, {@link #onPressSymbol()}, * {@link #onReleaseSymbol()}, {@link #onOtherKeyPressed()}, * {@link #onCodeInput(int, boolean, boolean)}, {@link #onCancelInput(boolean)}, - * {@link #onUpdateShiftState(boolean)}, {@link #onToggleShift()}, {@link #onToggleCapsLock()}, - * and {@link #onToggleAlphabetAndSymbols()}. + * {@link #onUpdateShiftState(boolean)}, and {@link #onToggleCapsLock()}. * * The actions are {@link SwitchActions}'s methods. */ @@ -219,7 +218,8 @@ public class KeyboardState { mSwitchActions.requestUpdatingShiftState(); } - private void setSymbolsKeyboard() { + // TODO: Make this method private + public void setSymbolsKeyboard() { if (DEBUG_STATE) { Log.d(TAG, "setSymbolsKeyboard"); } @@ -464,18 +464,6 @@ public class KeyboardState { } } - public void onToggleShift() { - if (DEBUG_STATE) { - Log.d(TAG, "onToggleShift: " + this); - } - if (mIsAlphabetMode) { - setShifted(mKeyboardShiftState.isShiftedOrShiftLocked() - ? SwitchActions.UNSHIFT : SwitchActions.MANUAL_SHIFT); - } else { - toggleShiftInSymbols(); - } - } - public void onToggleCapsLock() { if (DEBUG_STATE) { Log.d(TAG, "onToggleCapsLock: " + this); @@ -492,13 +480,6 @@ public class KeyboardState { } } - public void onToggleAlphabetAndSymbols() { - if (DEBUG_STATE) { - Log.d(TAG, "onToggleAlphabetAndSymbols: " + this); - } - toggleAlphabetAndSymbols(); - } - private static String shiftModeToString(int shiftMode) { switch (shiftMode) { case SwitchActions.UNSHIFT: return "UNSHIFT"; diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index f8fef8e92..b0d0da43b 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1261,16 +1261,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar LatinImeLogger.logOnDelete(); break; case Keyboard.CODE_SHIFT: - // Shift key is handled in onPress() when device has distinct multi-touch panel. - if (!distinctMultiTouch) { - switcher.toggleShift(); - } - break; case Keyboard.CODE_SWITCH_ALPHA_SYMBOL: - // Symbol key is handled in onPress() when device has distinct multi-touch panel. - if (!distinctMultiTouch) { - switcher.toggleAlphabetAndSymbols(); - } + // Shift and symbol key is handled in onPress() and onRelease(). break; case Keyboard.CODE_SETTINGS: onSettingsKeyPressed(); @@ -2271,10 +2263,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (switcher.isVibrateAndSoundFeedbackRequired()) { hapticAndAudioFeedback(primaryCode); } - final boolean distinctMultiTouch = switcher.hasDistinctMultitouch(); - if (distinctMultiTouch && primaryCode == Keyboard.CODE_SHIFT) { + if (primaryCode == Keyboard.CODE_SHIFT) { switcher.onPressShift(withSliding); - } else if (distinctMultiTouch && primaryCode == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) { + } else if (primaryCode == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) { switcher.onPressSymbol(); } else { switcher.onOtherKeyPressed(); @@ -2284,11 +2275,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar @Override public void onRelease(int primaryCode, boolean withSliding) { KeyboardSwitcher switcher = mKeyboardSwitcher; - // Reset any drag flags in the keyboard - final boolean distinctMultiTouch = switcher.hasDistinctMultitouch(); - if (distinctMultiTouch && primaryCode == Keyboard.CODE_SHIFT) { + if (primaryCode == Keyboard.CODE_SHIFT) { switcher.onReleaseShift(withSliding); - } else if (distinctMultiTouch && primaryCode == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) { + } else if (primaryCode == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) { switcher.onReleaseSymbol(); } } |