summaryrefslogtreecommitdiff
path: root/quantum/mousekey.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/mousekey.c')
-rw-r--r--quantum/mousekey.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/quantum/mousekey.c b/quantum/mousekey.c
index c982a2f40b..3910811752 100644
--- 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