From 32c54c4dbed0b27b7177f796d90a2ebb9566c9c9 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Fri, 3 Feb 2012 10:01:59 +0900 Subject: [PATCH] Fix key repeat interval timeout Bug: 5960472 Change-Id: I27d4b81d393f2ace946740a0b0801cea8c63b5b8 --- .../android/inputmethod/keyboard/LatinKeyboardView.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java index f3583fefc..8c0ae0ed1 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java @@ -132,7 +132,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke switch (msg.what) { case MSG_REPEAT_KEY: tracker.onRepeatKey(tracker.getKey()); - startKeyRepeatTimer(tracker); + startKeyRepeatTimer(tracker, mParams.mKeyRepeatInterval); break; case MSG_LONGPRESS_KEY: if (tracker != null) { @@ -144,11 +144,14 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke } } + private void startKeyRepeatTimer(PointerTracker tracker, long delay) { + sendMessageDelayed(obtainMessage(MSG_REPEAT_KEY, tracker), delay); + } + @Override public void startKeyRepeatTimer(PointerTracker tracker) { mInKeyRepeat = true; - sendMessageDelayed(obtainMessage(MSG_REPEAT_KEY, tracker), - mParams.mKeyRepeatStartTimeout); + startKeyRepeatTimer(tracker, mParams.mKeyRepeatStartTimeout); } public void cancelKeyRepeatTimer() {