mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Merge "Haptick and audio feedback on key repeat"
This commit is contained in:
commit
d88353266a
@ -240,7 +240,9 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
|||||||
case MSG_REPEAT_KEY:
|
case MSG_REPEAT_KEY:
|
||||||
final Key currentKey = tracker.getKey();
|
final Key currentKey = tracker.getKey();
|
||||||
if (currentKey != null && currentKey.mCode == msg.arg1) {
|
if (currentKey != null && currentKey.mCode == msg.arg1) {
|
||||||
tracker.onRegisterKey(currentKey);
|
tracker.onRepeatKey(currentKey);
|
||||||
|
AudioAndHapticFeedbackManager.getInstance().hapticAndAudioFeedback(
|
||||||
|
currentKey.mCode, keyboardView);
|
||||||
startKeyRepeatTimer(tracker, mKeyRepeatInterval);
|
startKeyRepeatTimer(tracker, mKeyRepeatInterval);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1266,16 +1266,14 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
|
|||||||
if (!key.isRepeatable()) return;
|
if (!key.isRepeatable()) return;
|
||||||
// Don't start key repeat when we are in sliding input mode.
|
// Don't start key repeat when we are in sliding input mode.
|
||||||
if (mIsInSlidingKeyInput) return;
|
if (mIsInSlidingKeyInput) return;
|
||||||
onRegisterKey(key);
|
onRepeatKey(key);
|
||||||
mTimerProxy.startKeyRepeatTimer(this);
|
mTimerProxy.startKeyRepeatTimer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onRegisterKey(final Key key) {
|
public void onRepeatKey(final Key key) {
|
||||||
if (key != null) {
|
|
||||||
detectAndSendKey(key, key.mX, key.mY, SystemClock.uptimeMillis());
|
detectAndSendKey(key, key.mX, key.mY, SystemClock.uptimeMillis());
|
||||||
mTimerProxy.startTypingStateTimer(key);
|
mTimerProxy.startTypingStateTimer(key);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isMajorEnoughMoveToBeOnNewKey(final int x, final int y, final long eventTime,
|
private boolean isMajorEnoughMoveToBeOnNewKey(final int x, final int y, final long eventTime,
|
||||||
final Key newKey) {
|
final Key newKey) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user