This commit is contained in:
Jonathan Zheng
2025-02-06 19:26:57 -08:00
committed by GitHub
2 changed files with 15 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

View File

@@ -174,6 +174,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#endif /* #ifndef MK_3_SPEED */
#ifndef MOUSEKEY_OVERLAP_MOVE_DELTA
# define MOUSEKEY_OVERLAP_MOVE_DELTA MOUSEKEY_MOVE_DELTA
#endif
#ifndef MOUSEKEY_OVERLAP_WHEEL_DELTA
# define MOUSEKEY_OVERLAP_WHEEL_DELTA MOUSEKEY_WHEEL_DELTA
#endif
#ifndef MOUSEKEY_OVERLAP_INTERVAL
# define MOUSEKEY_OVERLAP_INTERVAL MOUSEKEY_INTERVAL
#endif
#ifdef __cplusplus
extern "C" {
#endif