Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8835326 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android (Google) Code Review
Browse files

Merge "Haptick and audio feedback on key repeat"

parents 5fdea477 009488ea
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;
+4 −6
Original line number Diff line number Diff line
@@ -1266,16 +1266,14 @@ 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) {
    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,
            final Key newKey) {