qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

commit 246f3cb4d2d84df7869709d0f9ae5f3e2d99d4cc
parent 99290b4c7e891e69ca161d79c74a0e32014645bb
Author: フィルターペーパー <76888457+filterpaper@users.noreply.github.com>
Date:   Mon, 25 Sep 2023 10:25:24 +0800

Improve directional transition of overlapping mouse keys (#21494)


Diffstat:
Mquantum/mousekey.c | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/quantum/mousekey.c b/quantum/mousekey.c @@ -389,7 +389,20 @@ void mousekey_on(uint8_t code) { if (mouse_timer == 0) { mouse_timer = timer_read(); } -# endif /* #ifdef MK_KINETIC_SPEED */ +# endif + +# ifndef MOUSEKEY_INERTIA + // If mouse report is not zero, the current mousekey press is overlapping + // with another. Restart acceleration for smoother directional transition. + if (mouse_report.x || mouse_report.y || mouse_report.h || mouse_report.v) { +# ifdef MK_KINETIC_SPEED + mouse_timer = timer_read() - (MOUSEKEY_INTERVAL << 2); +# else + mousekey_repeat = MOUSEKEY_MOVE_DELTA; + mousekey_wheel_repeat = MOUSEKEY_WHEEL_DELTA; +# endif + } +# endif // ifndef MOUSEKEY_INERTIA # ifdef MOUSEKEY_INERTIA