Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve directional transition of overlapping mouse keys #21494

Merged
merged 2 commits into from
Sep 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Restart acceleration of overlapping mousekey press
Mouse movement will continue its acceleration in the new direction
of an overlapping mouse key press. This behaviour can be especially
jarring when the new overlapping key is for the opposite direction.

This change will restart the acceleration before processing the new
overlapping direction.
  • Loading branch information
filterpaper committed Jul 29, 2023
commit cfc10ae24dc173142e6c6825965ff7b693ec0cee
14 changes: 13 additions & 1 deletion quantum/mousekey.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,19 @@ void mousekey_on(uint8_t code) {
if (mouse_timer == 0) {
mouse_timer = timer_read();
}
# endif /* #ifdef MK_KINETIC_SPEED */
# endif

# ifndef MOUSEKEY_INERTIA
// Restart acceleration for overlapping mouse key presses
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

Expand Down