Loading java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +20 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,16 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, } } // Implements {@link KeyboardState.SwitchActions}. @Override public void cancelDoubleTapTimer() { final LatinKeyboardView keyboardView = getKeyboardView(); if (keyboardView != null) { final TimerProxy timer = keyboardView.getTimerProxy(); timer.cancelDoubleTapTimer(); } } // Implements {@link KeyboardState.SwitchActions}. @Override public boolean isInDoubleTapTimeout() { Loading @@ -284,6 +294,16 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, } } // Implements {@link KeyboardState.SwitchActions}. @Override public void cancelLongPressTimer() { final LatinKeyboardView keyboardView = getKeyboardView(); if (keyboardView != null) { final TimerProxy timer = keyboardView.getTimerProxy(); timer.cancelLongPressTimer(); } } // Implements {@link KeyboardState.SwitchActions}. @Override public void hapticAndAudioFeedback(int code) { Loading java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +5 −0 Original line number Diff line number Diff line Loading @@ -232,6 +232,11 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke ViewConfiguration.getDoubleTapTimeout()); } @Override public void cancelDoubleTapTimer() { removeMessages(MSG_DOUBLE_TAP); } @Override public boolean isInDoubleTapTimeout() { return hasMessages(MSG_DOUBLE_TAP); Loading java/src/com/android/inputmethod/keyboard/PointerTracker.java +3 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ public class PointerTracker { public void startLongPressTimer(int code); public void cancelLongPressTimer(); public void startDoubleTapTimer(); public void cancelDoubleTapTimer(); public boolean isInDoubleTapTimeout(); public void cancelKeyTimers(); Loading @@ -96,6 +97,8 @@ public class PointerTracker { @Override public void startDoubleTapTimer() {} @Override public void cancelDoubleTapTimer() {} @Override public boolean isInDoubleTapTimeout() { return false; } @Override public void cancelKeyTimers() {} Loading java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +10 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,9 @@ public class KeyboardState { public void startDoubleTapTimer(); public boolean isInDoubleTapTimeout(); public void cancelDoubleTapTimer(); public void startLongPressTimer(int code); public void cancelLongPressTimer(); public void hapticAndAudioFeedback(int code); } Loading Loading @@ -300,6 +302,8 @@ public class KeyboardState { } else if (code == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) { onPressSymbol(); } else { mSwitchActions.cancelDoubleTapTimer(); mSwitchActions.cancelLongPressTimer(); mShiftKeyState.onOtherKeyPressed(); mSymbolKeyState.onOtherKeyPressed(); } Loading Loading @@ -348,7 +352,7 @@ public class KeyboardState { // state. And mark as if shift key is released. mShiftKeyState.onRelease(); } else { // Shift key is long pressed while shift unloked state. // Shift key is long pressed while shift unlocked state. setShiftLocked(true); } mSwitchActions.hapticAndAudioFeedback(code); Loading @@ -364,6 +368,11 @@ public class KeyboardState { private void updateAlphabetShiftState(boolean autoCaps) { if (!mIsAlphabetMode) return; if (!mShiftKeyState.isReleasing()) { // Ignore update shift state event while the shift key is being pressed (including // chording). return; } if (!mAlphabetShiftState.isShiftLocked() && !mShiftKeyState.isIgnoring()) { if (mShiftKeyState.isReleasing() && autoCaps) { // Only when shift key is releasing, automatic temporary upper case will be set. Loading java/src/com/android/inputmethod/keyboard/internal/PointerTrackerQueue.java +21 −3 Original line number Diff line number Diff line Loading @@ -16,12 +16,18 @@ package com.android.inputmethod.keyboard.internal; import android.util.Log; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.PointerTracker; import java.util.Iterator; import java.util.LinkedList; public class PointerTrackerQueue { private static final String TAG = PointerTrackerQueue.class.getSimpleName(); private static final boolean DEBUG = false; private final LinkedList<PointerTracker> mQueue = new LinkedList<PointerTracker>(); public synchronized void add(PointerTracker tracker) { Loading @@ -32,7 +38,11 @@ public class PointerTrackerQueue { mQueue.remove(tracker); } public synchronized void releaseAllPointersOlderThan(PointerTracker tracker, long eventTime) { public synchronized void releaseAllPointersOlderThan(PointerTracker tracker, long eventTime) { if (DEBUG) { Log.d(TAG, "releaseAllPoniterOlderThan: [" + tracker.mPointerId + "] " + this); } if (!mQueue.contains(tracker)) { return; } Loading @@ -54,6 +64,13 @@ public class PointerTrackerQueue { } public synchronized void releaseAllPointersExcept(PointerTracker tracker, long eventTime) { if (DEBUG) { if (tracker == null) { Log.d(TAG, "releaseAllPoniters: " + this); } else { Log.d(TAG, "releaseAllPoniterExcept: [" + tracker.mPointerId + "] " + this); } } final Iterator<PointerTracker> it = mQueue.iterator(); while (it.hasNext()) { final PointerTracker t = it.next(); Loading @@ -79,8 +96,9 @@ public class PointerTrackerQueue { for (final PointerTracker tracker : mQueue) { if (sb.length() > 0) sb.append(" "); sb.append(tracker.mPointerId); sb.append("[" + tracker.mPointerId + " " + Keyboard.printableCode(tracker.getKey().mCode) + "]"); } return "[" + sb + "]"; return sb.toString(); } } Loading
java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +20 −0 Original line number Diff line number Diff line Loading @@ -266,6 +266,16 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, } } // Implements {@link KeyboardState.SwitchActions}. @Override public void cancelDoubleTapTimer() { final LatinKeyboardView keyboardView = getKeyboardView(); if (keyboardView != null) { final TimerProxy timer = keyboardView.getTimerProxy(); timer.cancelDoubleTapTimer(); } } // Implements {@link KeyboardState.SwitchActions}. @Override public boolean isInDoubleTapTimeout() { Loading @@ -284,6 +294,16 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, } } // Implements {@link KeyboardState.SwitchActions}. @Override public void cancelLongPressTimer() { final LatinKeyboardView keyboardView = getKeyboardView(); if (keyboardView != null) { final TimerProxy timer = keyboardView.getTimerProxy(); timer.cancelLongPressTimer(); } } // Implements {@link KeyboardState.SwitchActions}. @Override public void hapticAndAudioFeedback(int code) { Loading
java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +5 −0 Original line number Diff line number Diff line Loading @@ -232,6 +232,11 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke ViewConfiguration.getDoubleTapTimeout()); } @Override public void cancelDoubleTapTimer() { removeMessages(MSG_DOUBLE_TAP); } @Override public boolean isInDoubleTapTimeout() { return hasMessages(MSG_DOUBLE_TAP); Loading
java/src/com/android/inputmethod/keyboard/PointerTracker.java +3 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ public class PointerTracker { public void startLongPressTimer(int code); public void cancelLongPressTimer(); public void startDoubleTapTimer(); public void cancelDoubleTapTimer(); public boolean isInDoubleTapTimeout(); public void cancelKeyTimers(); Loading @@ -96,6 +97,8 @@ public class PointerTracker { @Override public void startDoubleTapTimer() {} @Override public void cancelDoubleTapTimer() {} @Override public boolean isInDoubleTapTimeout() { return false; } @Override public void cancelKeyTimers() {} Loading
java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +10 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,9 @@ public class KeyboardState { public void startDoubleTapTimer(); public boolean isInDoubleTapTimeout(); public void cancelDoubleTapTimer(); public void startLongPressTimer(int code); public void cancelLongPressTimer(); public void hapticAndAudioFeedback(int code); } Loading Loading @@ -300,6 +302,8 @@ public class KeyboardState { } else if (code == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) { onPressSymbol(); } else { mSwitchActions.cancelDoubleTapTimer(); mSwitchActions.cancelLongPressTimer(); mShiftKeyState.onOtherKeyPressed(); mSymbolKeyState.onOtherKeyPressed(); } Loading Loading @@ -348,7 +352,7 @@ public class KeyboardState { // state. And mark as if shift key is released. mShiftKeyState.onRelease(); } else { // Shift key is long pressed while shift unloked state. // Shift key is long pressed while shift unlocked state. setShiftLocked(true); } mSwitchActions.hapticAndAudioFeedback(code); Loading @@ -364,6 +368,11 @@ public class KeyboardState { private void updateAlphabetShiftState(boolean autoCaps) { if (!mIsAlphabetMode) return; if (!mShiftKeyState.isReleasing()) { // Ignore update shift state event while the shift key is being pressed (including // chording). return; } if (!mAlphabetShiftState.isShiftLocked() && !mShiftKeyState.isIgnoring()) { if (mShiftKeyState.isReleasing() && autoCaps) { // Only when shift key is releasing, automatic temporary upper case will be set. Loading
java/src/com/android/inputmethod/keyboard/internal/PointerTrackerQueue.java +21 −3 Original line number Diff line number Diff line Loading @@ -16,12 +16,18 @@ package com.android.inputmethod.keyboard.internal; import android.util.Log; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.PointerTracker; import java.util.Iterator; import java.util.LinkedList; public class PointerTrackerQueue { private static final String TAG = PointerTrackerQueue.class.getSimpleName(); private static final boolean DEBUG = false; private final LinkedList<PointerTracker> mQueue = new LinkedList<PointerTracker>(); public synchronized void add(PointerTracker tracker) { Loading @@ -32,7 +38,11 @@ public class PointerTrackerQueue { mQueue.remove(tracker); } public synchronized void releaseAllPointersOlderThan(PointerTracker tracker, long eventTime) { public synchronized void releaseAllPointersOlderThan(PointerTracker tracker, long eventTime) { if (DEBUG) { Log.d(TAG, "releaseAllPoniterOlderThan: [" + tracker.mPointerId + "] " + this); } if (!mQueue.contains(tracker)) { return; } Loading @@ -54,6 +64,13 @@ public class PointerTrackerQueue { } public synchronized void releaseAllPointersExcept(PointerTracker tracker, long eventTime) { if (DEBUG) { if (tracker == null) { Log.d(TAG, "releaseAllPoniters: " + this); } else { Log.d(TAG, "releaseAllPoniterExcept: [" + tracker.mPointerId + "] " + this); } } final Iterator<PointerTracker> it = mQueue.iterator(); while (it.hasNext()) { final PointerTracker t = it.next(); Loading @@ -79,8 +96,9 @@ public class PointerTrackerQueue { for (final PointerTracker tracker : mQueue) { if (sb.length() > 0) sb.append(" "); sb.append(tracker.mPointerId); sb.append("[" + tracker.mPointerId + " " + Keyboard.printableCode(tracker.getKey().mCode) + "]"); } return "[" + sb + "]"; return sb.toString(); } }