Loading java/src/com/android/inputmethod/keyboard/Keyboard.java +4 −3 Original line number Diff line number Diff line Loading @@ -434,9 +434,10 @@ public class Keyboard { case CODE_SHORTCUT: return "shortcut"; case CODE_UNSPECIFIED: return "unspec"; default: if (code < 0) Log.w(TAG, "Unknow negative key code=" + code); if (code < 0x100) return String.format("\\u%02x", code); return String.format("\\u04x", code); if (code <= 0) Log.w(TAG, "Unknown non-positive key code=" + code); if (code < CODE_SPACE) return String.format("'\\u%02x'", code); if (code < 0x100) return String.format("'%c'", code); return String.format("'\\u%04x'", code); } } Loading java/src/com/android/inputmethod/keyboard/KeyboardActionListener.java +4 −6 Original line number Diff line number Diff line Loading @@ -24,10 +24,8 @@ public interface KeyboardActionListener { * * @param primaryCode the unicode of the key being pressed. If the touch is not on a valid key, * the value will be zero. * @param withSliding true if pressing has occurred because the user slid finger from other key * to this key without releasing the finger. */ public void onPress(int primaryCode, boolean withSliding); public void onPressKey(int primaryCode); /** * Called when the user releases a key. This is sent after the {@link #onCodeInput} is called. Loading @@ -37,7 +35,7 @@ public interface KeyboardActionListener { * @param withSliding true if releasing has occurred because the user slid finger from the key * to other key without releasing the finger. */ public void onRelease(int primaryCode, boolean withSliding); public void onReleaseKey(int primaryCode, boolean withSliding); /** * Send a key code to the listener. Loading Loading @@ -79,9 +77,9 @@ public interface KeyboardActionListener { public static class Adapter implements KeyboardActionListener { @Override public void onPress(int primaryCode, boolean withSliding) {} public void onPressKey(int primaryCode) {} @Override public void onRelease(int primaryCode, boolean withSliding) {} public void onReleaseKey(int primaryCode, boolean withSliding) {} @Override public void onCodeInput(int primaryCode, int[] keyCodes, int x, int y) {} @Override Loading java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +4 −16 Original line number Diff line number Diff line Loading @@ -270,24 +270,12 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, mState.onUpdateShiftState(mInputMethodService.getCurrentAutoCapsState()); } public void onPressShift(boolean withSliding) { mState.onPressShift(withSliding); public void onPressKey(int code) { mState.onPressKey(code); } public void onReleaseShift(boolean withSliding) { mState.onReleaseShift(withSliding); } public void onPressSymbol() { mState.onPressSymbol(); } public void onReleaseSymbol() { mState.onReleaseSymbol(); } public void onOtherKeyPressed() { mState.onOtherKeyPressed(); public void onReleaseKey(int code, boolean withSliding) { mState.onReleaseKey(code, withSliding); } public void onCancelInput() { Loading java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +6 −6 Original line number Diff line number Diff line Loading @@ -417,9 +417,9 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke // the second tap is treated as this double tap event, so that we need not mark tracker // calling setAlreadyProcessed() nor remove the tracker from mPointerQueue. if (ignore) { mKeyboardActionListener.onCustomRequest(LatinIME.CODE_HAPTIC_AND_AUDIO_FEEDBACK); invokeCustomRequest(LatinIME.CODE_HAPTIC_AND_AUDIO_FEEDBACK); } else { mKeyboardActionListener.onCodeInput(Keyboard.CODE_CAPSLOCK, null, 0, 0); invokeCodeInput(Keyboard.CODE_CAPSLOCK); } } Loading Loading @@ -479,17 +479,17 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke } private boolean invokeCustomRequest(int code) { return getKeyboardActionListener().onCustomRequest(code); return mKeyboardActionListener.onCustomRequest(code); } private void invokeCodeInput(int primaryCode) { getKeyboardActionListener().onCodeInput(primaryCode, null, mKeyboardActionListener.onCodeInput(primaryCode, null, KeyboardActionListener.NOT_A_TOUCH_COORDINATE, KeyboardActionListener.NOT_A_TOUCH_COORDINATE); } private void invokeReleaseKey(int primaryCode) { getKeyboardActionListener().onRelease(primaryCode, false); mKeyboardActionListener.onReleaseKey(primaryCode, false); } private boolean openMoreKeysPanel(Key parentKey, PointerTracker tracker) { Loading @@ -514,7 +514,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke : parentKey.mX + parentKey.mWidth / 2; final int pointY = parentKey.mY - keyboard.mVerticalGap; moreKeysPanel.showMoreKeysPanel( this, this, pointX, pointY, mMoreKeysWindow, getKeyboardActionListener()); this, this, pointX, pointY, mMoreKeysWindow, mKeyboardActionListener); final int translatedX = moreKeysPanel.translateX(tracker.getLastX()); final int translatedY = moreKeysPanel.translateY(tracker.getLastY()); tracker.onShowMoreKeysPanel(translatedX, translatedY, moreKeysPanel); Loading java/src/com/android/inputmethod/keyboard/MiniKeyboardView.java +5 −4 Original line number Diff line number Diff line Loading @@ -61,12 +61,13 @@ public class MiniKeyboardView extends KeyboardView implements MoreKeysPanel { } @Override public void onPress(int primaryCode, boolean withSliding) { mListener.onPress(primaryCode, withSliding); public void onPressKey(int primaryCode) { mListener.onPressKey(primaryCode); } @Override public void onRelease(int primaryCode, boolean withSliding) { mListener.onRelease(primaryCode, withSliding); public void onReleaseKey(int primaryCode, boolean withSliding) { mListener.onReleaseKey(primaryCode, withSliding); } }; Loading Loading
java/src/com/android/inputmethod/keyboard/Keyboard.java +4 −3 Original line number Diff line number Diff line Loading @@ -434,9 +434,10 @@ public class Keyboard { case CODE_SHORTCUT: return "shortcut"; case CODE_UNSPECIFIED: return "unspec"; default: if (code < 0) Log.w(TAG, "Unknow negative key code=" + code); if (code < 0x100) return String.format("\\u%02x", code); return String.format("\\u04x", code); if (code <= 0) Log.w(TAG, "Unknown non-positive key code=" + code); if (code < CODE_SPACE) return String.format("'\\u%02x'", code); if (code < 0x100) return String.format("'%c'", code); return String.format("'\\u%04x'", code); } } Loading
java/src/com/android/inputmethod/keyboard/KeyboardActionListener.java +4 −6 Original line number Diff line number Diff line Loading @@ -24,10 +24,8 @@ public interface KeyboardActionListener { * * @param primaryCode the unicode of the key being pressed. If the touch is not on a valid key, * the value will be zero. * @param withSliding true if pressing has occurred because the user slid finger from other key * to this key without releasing the finger. */ public void onPress(int primaryCode, boolean withSliding); public void onPressKey(int primaryCode); /** * Called when the user releases a key. This is sent after the {@link #onCodeInput} is called. Loading @@ -37,7 +35,7 @@ public interface KeyboardActionListener { * @param withSliding true if releasing has occurred because the user slid finger from the key * to other key without releasing the finger. */ public void onRelease(int primaryCode, boolean withSliding); public void onReleaseKey(int primaryCode, boolean withSliding); /** * Send a key code to the listener. Loading Loading @@ -79,9 +77,9 @@ public interface KeyboardActionListener { public static class Adapter implements KeyboardActionListener { @Override public void onPress(int primaryCode, boolean withSliding) {} public void onPressKey(int primaryCode) {} @Override public void onRelease(int primaryCode, boolean withSliding) {} public void onReleaseKey(int primaryCode, boolean withSliding) {} @Override public void onCodeInput(int primaryCode, int[] keyCodes, int x, int y) {} @Override Loading
java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +4 −16 Original line number Diff line number Diff line Loading @@ -270,24 +270,12 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions, mState.onUpdateShiftState(mInputMethodService.getCurrentAutoCapsState()); } public void onPressShift(boolean withSliding) { mState.onPressShift(withSliding); public void onPressKey(int code) { mState.onPressKey(code); } public void onReleaseShift(boolean withSliding) { mState.onReleaseShift(withSliding); } public void onPressSymbol() { mState.onPressSymbol(); } public void onReleaseSymbol() { mState.onReleaseSymbol(); } public void onOtherKeyPressed() { mState.onOtherKeyPressed(); public void onReleaseKey(int code, boolean withSliding) { mState.onReleaseKey(code, withSliding); } public void onCancelInput() { Loading
java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +6 −6 Original line number Diff line number Diff line Loading @@ -417,9 +417,9 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke // the second tap is treated as this double tap event, so that we need not mark tracker // calling setAlreadyProcessed() nor remove the tracker from mPointerQueue. if (ignore) { mKeyboardActionListener.onCustomRequest(LatinIME.CODE_HAPTIC_AND_AUDIO_FEEDBACK); invokeCustomRequest(LatinIME.CODE_HAPTIC_AND_AUDIO_FEEDBACK); } else { mKeyboardActionListener.onCodeInput(Keyboard.CODE_CAPSLOCK, null, 0, 0); invokeCodeInput(Keyboard.CODE_CAPSLOCK); } } Loading Loading @@ -479,17 +479,17 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke } private boolean invokeCustomRequest(int code) { return getKeyboardActionListener().onCustomRequest(code); return mKeyboardActionListener.onCustomRequest(code); } private void invokeCodeInput(int primaryCode) { getKeyboardActionListener().onCodeInput(primaryCode, null, mKeyboardActionListener.onCodeInput(primaryCode, null, KeyboardActionListener.NOT_A_TOUCH_COORDINATE, KeyboardActionListener.NOT_A_TOUCH_COORDINATE); } private void invokeReleaseKey(int primaryCode) { getKeyboardActionListener().onRelease(primaryCode, false); mKeyboardActionListener.onReleaseKey(primaryCode, false); } private boolean openMoreKeysPanel(Key parentKey, PointerTracker tracker) { Loading @@ -514,7 +514,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke : parentKey.mX + parentKey.mWidth / 2; final int pointY = parentKey.mY - keyboard.mVerticalGap; moreKeysPanel.showMoreKeysPanel( this, this, pointX, pointY, mMoreKeysWindow, getKeyboardActionListener()); this, this, pointX, pointY, mMoreKeysWindow, mKeyboardActionListener); final int translatedX = moreKeysPanel.translateX(tracker.getLastX()); final int translatedY = moreKeysPanel.translateY(tracker.getLastY()); tracker.onShowMoreKeysPanel(translatedX, translatedY, moreKeysPanel); Loading
java/src/com/android/inputmethod/keyboard/MiniKeyboardView.java +5 −4 Original line number Diff line number Diff line Loading @@ -61,12 +61,13 @@ public class MiniKeyboardView extends KeyboardView implements MoreKeysPanel { } @Override public void onPress(int primaryCode, boolean withSliding) { mListener.onPress(primaryCode, withSliding); public void onPressKey(int primaryCode) { mListener.onPressKey(primaryCode); } @Override public void onRelease(int primaryCode, boolean withSliding) { mListener.onRelease(primaryCode, withSliding); public void onReleaseKey(int primaryCode, boolean withSliding) { mListener.onReleaseKey(primaryCode, withSliding); } }; Loading