Loading java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +0 −7 Original line number Diff line number Diff line Loading @@ -256,13 +256,6 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, } } /** * Toggle caps lock state triggered by user touch event. */ public void toggleCapsLock() { mState.onToggleCapsLock(); } /** * Update keyboard shift state triggered by connected EditText status change. */ Loading java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +13 −17 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ import com.android.inputmethod.keyboard.Keyboard; * The input events are {@link #onLoadKeyboard(String, boolean)}, {@link #onSaveKeyboardState()}, * {@link #onPressKey(int)}, {@link #onReleaseKey(int, boolean)}, * {@link #onCodeInput(int, boolean, boolean)}, {@link #onCancelInput(boolean)}, * {@link #onUpdateShiftState(boolean)}, and {@link #onToggleCapsLock()}. * {@link #onUpdateShiftState(boolean)}. * * The actions are {@link SwitchActions}'s methods. */ Loading Loading @@ -403,6 +403,18 @@ public class KeyboardState { + " single=" + isSinglePointer + " autoCaps=" + autoCaps + " " + this); } if (mIsAlphabetMode && code == Keyboard.CODE_CAPSLOCK) { if (mKeyboardShiftState.isShiftLocked()) { setShiftLocked(false); // Shift key is long pressed or double tapped while caps lock state, we will // toggle back to normal state. And mark as if shift key is released. mShiftKeyState.onRelease(); } else { setShiftLocked(true); } } switch (mSwitchState) { case SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL: // Only distinct multi touch devices can be in this state. Loading Loading @@ -471,22 +483,6 @@ public class KeyboardState { } } public void onToggleCapsLock() { if (DEBUG_EVENT) { Log.d(TAG, "onToggleCapsLock: " + this); } if (mIsAlphabetMode) { if (mKeyboardShiftState.isShiftLocked()) { setShiftLocked(false); // Shift key is long pressed while caps lock state, we will toggle back to normal // state. And mark as if shift key is released. mShiftKeyState.onRelease(); } else { setShiftLocked(true); } } } private static String shiftModeToString(int shiftMode) { switch (shiftMode) { case SwitchActions.UNSHIFT: return "UNSHIFT"; Loading java/src/com/android/inputmethod/latin/LatinIME.java +1 −1 Original line number Diff line number Diff line Loading @@ -1267,7 +1267,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar onSettingsKeyPressed(); break; case Keyboard.CODE_CAPSLOCK: switcher.toggleCapsLock(); // Caps lock code is handled in KeyboardSwitcher.onCodeInput() below. hapticAndAudioFeedback(primaryCode); break; case Keyboard.CODE_SHORTCUT: Loading tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateNonDistinctTests.java +0 −6 Original line number Diff line number Diff line Loading @@ -342,8 +342,6 @@ public class KeyboardStateNonDistinctTests extends AndroidTestCase mSwitcher.onPressKey(CODE_SHIFT); assertAlphabetManualShifted(); // Long press recognized in LatinKeyboardView.KeyTimerHandler. mSwitcher.toggleCapsLock(); assertAlphabetShiftLocked(); mSwitcher.onCodeInput(CODE_CAPSLOCK); assertAlphabetShiftLocked(); mSwitcher.onReleaseKey(CODE_SHIFT); Loading @@ -355,8 +353,6 @@ public class KeyboardStateNonDistinctTests extends AndroidTestCase mSwitcher.onPressKey(CODE_SHIFT); assertAlphabetManualShifted(); // Long press recognized in LatinKeyboardView.KeyTimerHandler. mSwitcher.toggleCapsLock(); assertAlphabetNormal(); mSwitcher.onCodeInput(CODE_CAPSLOCK); assertAlphabetNormal(); mSwitcher.onReleaseKey(CODE_SHIFT); Loading Loading @@ -396,8 +392,6 @@ public class KeyboardStateNonDistinctTests extends AndroidTestCase assertAlphabetManualShifted(); // Second shift key tap. // Double tap recognized in LatinKeyboardView.KeyTimerHandler. mSwitcher.toggleCapsLock(); assertAlphabetShiftLocked(); mSwitcher.onCodeInput(CODE_CAPSLOCK); assertAlphabetShiftLocked(); Loading tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.inputmethod.keyboard.internal; import com.android.inputmethod.keyboard.Keyboard; public class KeyboardStateTests extends KeyboardStateNonDistinctTests { @Override public boolean hasDistinctMultitouch() { Loading @@ -27,7 +25,7 @@ public class KeyboardStateTests extends KeyboardStateNonDistinctTests { // Shift key chording input. public void testShiftChording() { // Press shift key and hold, enter into choring shift state. mSwitcher.onPressKey(Keyboard.CODE_SHIFT); mSwitcher.onPressKey(CODE_SHIFT); assertAlphabetManualShifted(); // Press/release letter keys. Loading Loading @@ -114,4 +112,6 @@ public class KeyboardStateTests extends KeyboardStateNonDistinctTests { } // TODO: Multitouch test // TODO: n-Keys roll over test } Loading
java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +0 −7 Original line number Diff line number Diff line Loading @@ -256,13 +256,6 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, } } /** * Toggle caps lock state triggered by user touch event. */ public void toggleCapsLock() { mState.onToggleCapsLock(); } /** * Update keyboard shift state triggered by connected EditText status change. */ Loading
java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +13 −17 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ import com.android.inputmethod.keyboard.Keyboard; * The input events are {@link #onLoadKeyboard(String, boolean)}, {@link #onSaveKeyboardState()}, * {@link #onPressKey(int)}, {@link #onReleaseKey(int, boolean)}, * {@link #onCodeInput(int, boolean, boolean)}, {@link #onCancelInput(boolean)}, * {@link #onUpdateShiftState(boolean)}, and {@link #onToggleCapsLock()}. * {@link #onUpdateShiftState(boolean)}. * * The actions are {@link SwitchActions}'s methods. */ Loading Loading @@ -403,6 +403,18 @@ public class KeyboardState { + " single=" + isSinglePointer + " autoCaps=" + autoCaps + " " + this); } if (mIsAlphabetMode && code == Keyboard.CODE_CAPSLOCK) { if (mKeyboardShiftState.isShiftLocked()) { setShiftLocked(false); // Shift key is long pressed or double tapped while caps lock state, we will // toggle back to normal state. And mark as if shift key is released. mShiftKeyState.onRelease(); } else { setShiftLocked(true); } } switch (mSwitchState) { case SWITCH_STATE_MOMENTARY_ALPHA_AND_SYMBOL: // Only distinct multi touch devices can be in this state. Loading Loading @@ -471,22 +483,6 @@ public class KeyboardState { } } public void onToggleCapsLock() { if (DEBUG_EVENT) { Log.d(TAG, "onToggleCapsLock: " + this); } if (mIsAlphabetMode) { if (mKeyboardShiftState.isShiftLocked()) { setShiftLocked(false); // Shift key is long pressed while caps lock state, we will toggle back to normal // state. And mark as if shift key is released. mShiftKeyState.onRelease(); } else { setShiftLocked(true); } } } private static String shiftModeToString(int shiftMode) { switch (shiftMode) { case SwitchActions.UNSHIFT: return "UNSHIFT"; Loading
java/src/com/android/inputmethod/latin/LatinIME.java +1 −1 Original line number Diff line number Diff line Loading @@ -1267,7 +1267,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar onSettingsKeyPressed(); break; case Keyboard.CODE_CAPSLOCK: switcher.toggleCapsLock(); // Caps lock code is handled in KeyboardSwitcher.onCodeInput() below. hapticAndAudioFeedback(primaryCode); break; case Keyboard.CODE_SHORTCUT: Loading
tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateNonDistinctTests.java +0 −6 Original line number Diff line number Diff line Loading @@ -342,8 +342,6 @@ public class KeyboardStateNonDistinctTests extends AndroidTestCase mSwitcher.onPressKey(CODE_SHIFT); assertAlphabetManualShifted(); // Long press recognized in LatinKeyboardView.KeyTimerHandler. mSwitcher.toggleCapsLock(); assertAlphabetShiftLocked(); mSwitcher.onCodeInput(CODE_CAPSLOCK); assertAlphabetShiftLocked(); mSwitcher.onReleaseKey(CODE_SHIFT); Loading @@ -355,8 +353,6 @@ public class KeyboardStateNonDistinctTests extends AndroidTestCase mSwitcher.onPressKey(CODE_SHIFT); assertAlphabetManualShifted(); // Long press recognized in LatinKeyboardView.KeyTimerHandler. mSwitcher.toggleCapsLock(); assertAlphabetNormal(); mSwitcher.onCodeInput(CODE_CAPSLOCK); assertAlphabetNormal(); mSwitcher.onReleaseKey(CODE_SHIFT); Loading Loading @@ -396,8 +392,6 @@ public class KeyboardStateNonDistinctTests extends AndroidTestCase assertAlphabetManualShifted(); // Second shift key tap. // Double tap recognized in LatinKeyboardView.KeyTimerHandler. mSwitcher.toggleCapsLock(); assertAlphabetShiftLocked(); mSwitcher.onCodeInput(CODE_CAPSLOCK); assertAlphabetShiftLocked(); Loading
tests/src/com/android/inputmethod/keyboard/internal/KeyboardStateTests.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.inputmethod.keyboard.internal; import com.android.inputmethod.keyboard.Keyboard; public class KeyboardStateTests extends KeyboardStateNonDistinctTests { @Override public boolean hasDistinctMultitouch() { Loading @@ -27,7 +25,7 @@ public class KeyboardStateTests extends KeyboardStateNonDistinctTests { // Shift key chording input. public void testShiftChording() { // Press shift key and hold, enter into choring shift state. mSwitcher.onPressKey(Keyboard.CODE_SHIFT); mSwitcher.onPressKey(CODE_SHIFT); assertAlphabetManualShifted(); // Press/release letter keys. Loading Loading @@ -114,4 +112,6 @@ public class KeyboardStateTests extends KeyboardStateNonDistinctTests { } // TODO: Multitouch test // TODO: n-Keys roll over test }