From 87e7637f8d242d3e8e06d0ba76ecf86bbd8af3c7 Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 27 Sep 2026 19:09:46 +0200 Subject: properly implement msmouse-like sensitivity, separate from speed --- int33.h | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'int33.h') diff --git a/int33.h b/int33.h index df870be..f9191ce 100644 --- a/int33.h +++ b/int33.h @@ -114,12 +114,38 @@ enum INT33_API { INT33_SAVE_MOUSE_STATUS = 0x16, INT33_LOAD_MOUSE_STATUS = 0x17, - /** Sets both speed and speed-doubling threshold in one call. - * @param bx horizontal speed, cx vertical speed - * @param dx doubling threshold (mickeys per second). */ + /** Sets both sensitivity and speed-doubling threshold in one call. + * @param bx horizontal sensitivity, cx vertical sensitivity + * these are values from 5..100. + * @param dx speed doubling threshold (mickeys per second?). + * Unlike set_mouse_speed, this value is persistent, and survives a reset. + * MS doesn't define what "sensitivity" means here, however MSD does print + * a table of common sensitivity values and their equivalent "factor", + * which is applied to the mouse deltas: + * 100 - 3.5 (i.e. mouse is 3.5x faster) + * 95 - 3.25 + * 90 - 3 + * 85 - 2.75 + * 80 - 2.5 + * 75 - 2.25 + * 70 - 2 + * 65 - 1.75 + * 60 - 1.5 + * 55 - 1.25 + * 50 - 1 (default value, mouse is 1x) + * 45 - 0.875 + * 40 - 0.75 + * 35 - 0.625 + * 30 - 0.5 + * 25 - 0.375 + * 20 - 0.25 + * 15 - 0.125 + * 10 - 0.062 + * 5 - 0.031 (MSD prints 0.31 though? looks buggy as hell). + * @todo verify if the doubling threshold here is in the same units. */ INT33_SET_MOUSE_SENSITIVITY = 0x1A, - /** Gets current speed and speed-doubling threshold. - * @return bx horizontal speed, cx vertical speed + /** Gets current sensitivity and speed-doubling threshold. + * @return bx horizontal sensitivity, cx vertical sensitivity * @return dx doubling threshold (mickeys per second). */ INT33_GET_MOUSE_SENSITIVITY = 0x1B, -- cgit v1.2.3