Fix key repeat interval timeout
Bug: 5960472 Change-Id: I27d4b81d393f2ace946740a0b0801cea8c63b5b8main
parent
44e0e4f99e
commit
32c54c4dbe
|
@ -132,7 +132,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
|
||||||
switch (msg.what) {
|
switch (msg.what) {
|
||||||
case MSG_REPEAT_KEY:
|
case MSG_REPEAT_KEY:
|
||||||
tracker.onRepeatKey(tracker.getKey());
|
tracker.onRepeatKey(tracker.getKey());
|
||||||
startKeyRepeatTimer(tracker);
|
startKeyRepeatTimer(tracker, mParams.mKeyRepeatInterval);
|
||||||
break;
|
break;
|
||||||
case MSG_LONGPRESS_KEY:
|
case MSG_LONGPRESS_KEY:
|
||||||
if (tracker != null) {
|
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
|
@Override
|
||||||
public void startKeyRepeatTimer(PointerTracker tracker) {
|
public void startKeyRepeatTimer(PointerTracker tracker) {
|
||||||
mInKeyRepeat = true;
|
mInKeyRepeat = true;
|
||||||
sendMessageDelayed(obtainMessage(MSG_REPEAT_KEY, tracker),
|
startKeyRepeatTimer(tracker, mParams.mKeyRepeatStartTimeout);
|
||||||
mParams.mKeyRepeatStartTimeout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cancelKeyRepeatTimer() {
|
public void cancelKeyRepeatTimer() {
|
||||||
|
|
Loading…
Reference in New Issue