From 009488eaaf25f04ca841f7741dc8b270f7da9000 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 21 May 2013 16:17:35 -0700 Subject: [PATCH] Haptick and audio feedback on key repeat Bug: 6522943 Change-Id: I181f7e8722bf1b3042d7f384ae8ebf87f29458a9 --- .../android/inputmethod/keyboard/MainKeyboardView.java | 4 +++- .../android/inputmethod/keyboard/PointerTracker.java | 10 ++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java index 6c6fc6157..25e71a245 100644 --- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java @@ -240,7 +240,9 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack case MSG_REPEAT_KEY: final Key currentKey = tracker.getKey(); if (currentKey != null && currentKey.mCode == msg.arg1) { - tracker.onRegisterKey(currentKey); + tracker.onRepeatKey(currentKey); + AudioAndHapticFeedbackManager.getInstance().hapticAndAudioFeedback( + currentKey.mCode, keyboardView); startKeyRepeatTimer(tracker, mKeyRepeatInterval); } break; diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index 174239325..5df7011cb 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -1266,15 +1266,13 @@ public final class PointerTracker implements PointerTrackerQueue.Element { if (!key.isRepeatable()) return; // Don't start key repeat when we are in sliding input mode. if (mIsInSlidingKeyInput) return; - onRegisterKey(key); + onRepeatKey(key); mTimerProxy.startKeyRepeatTimer(this); } - public void onRegisterKey(final Key key) { - if (key != null) { - detectAndSendKey(key, key.mX, key.mY, SystemClock.uptimeMillis()); - mTimerProxy.startTypingStateTimer(key); - } + public void onRepeatKey(final Key key) { + detectAndSendKey(key, key.mX, key.mY, SystemClock.uptimeMillis()); + mTimerProxy.startTypingStateTimer(key); } private boolean isMajorEnoughMoveToBeOnNewKey(final int x, final int y, final long eventTime,