1
0
Fork 0

Enhance overlapping mouse keys control (#23341)

Enhance the overlapping mouse key press acceleration (introduced in #21494) with user preprocessor controls.
This commit is contained in:
フィルターペーパー 2024-08-19 10:18:28 +08:00 committed by GitHub
parent e9cb9f42a5
commit 21b84596e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 5 deletions

View file

@ -391,18 +391,18 @@ void mousekey_on(uint8_t code) {
}
# endif
# ifndef MOUSEKEY_INERTIA
# if defined(MOUSEKEY_OVERLAP_RESET) && !defined(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);
mouse_timer = timer_read() - MOUSEKEY_OVERLAP_INTERVAL;
# else
mousekey_repeat = MOUSEKEY_MOVE_DELTA;
mousekey_wheel_repeat = MOUSEKEY_WHEEL_DELTA;
mousekey_repeat = MOUSEKEY_OVERLAP_MOVE_DELTA;
mousekey_wheel_repeat = MOUSEKEY_OVERLAP_WHEEL_DELTA;
# endif
}
# endif // ifndef MOUSEKEY_INERTIA
# endif // defined(MOUSEKEY_OVERLAP_RESET) && !defined(MOUSEKEY_INERTIA)
# ifdef MOUSEKEY_INERTIA