From b73c038b18e2e838366f389d81038344b917eb56 Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 23 Sep 2026 22:51:08 +0200 Subject: rework how acceleration works and avoid acceleration influencing raw mickey counts (as given to e.g. windows) --- mousetsr.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'mousetsr.h') diff --git a/mousetsr.h b/mousetsr.h index 704f670..9b8fdf8 100644 --- a/mousetsr.h +++ b/mousetsr.h @@ -159,10 +159,10 @@ typedef struct tsrdata { uint8_t port_irq; // Current mouse settings - /** Mouse sensitivity/speed. */ - struct point mickeysPerLine; // mickeys per 8 pixels - /** Mouse acceleration "double-speed threshold". */ - uint16_t doubleSpeedThreshold; // mickeys + /** Mouse speed, in mickeys per "line" (aka 8 pixels). */ + struct point mickeysPerLine; + /** Mouse acceleration "double-speed threshold", in mickeys per second. */ + uint16_t doubleSpeedThreshold; /** Current window min coordinates. */ struct point min; /** Current window max coordinates. */ @@ -191,12 +191,11 @@ typedef struct tsrdata { struct point pos_frac; /** Current delta movement (in mickeys) since the last report. */ struct point delta; - /** Current remainder of delta movement that does not yet translate to an entire mickey - * Usually only when mickeysPerLine is not a multiple of 8. */ - struct point delta_frac; /** Last absolute position (to compute a delta for relative motion emulation). Using -1 for "none". */ struct point abs_pos; - /** Total mickeys moved in the last second. */ + /** Current calculated mouse speed (in mickeys/second) */ + uint16_t cur_speed; + /** Total mickeys moved in the last tick. */ uint16_t total_motion; /** Ticks when the above value was last reset. */ uint16_t last_motion_ticks; -- cgit v1.2.3