mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-07 11:59:59 +03:00
* fix(macos): forward back/forward mouse buttons in capture and emulation OtherMouseDown/Up events on macOS carry a button number field that distinguishes middle (2), back (3), and forward (4) buttons. The capture backend was unconditionally mapping all OtherMouse events to BTN_MIDDLE, silently dropping back/forward. The emulation backend had no match arms for BTN_BACK/BTN_FORWARD, causing them to be dropped with a warning. Fix capture by reading MOUSE_EVENT_BUTTON_NUMBER and mapping 3->BTN_BACK, 4->BTN_FORWARD. Fix emulation by adding match arms for BTN_BACK/BTN_FORWARD and setting MOUSE_EVENT_BUTTON_NUMBER on the emitted CGEvent so macOS apps receive the correct button identity. * fix(macos): track button state and double-clicks by evdev code instead of CGMouseButton Back, forward, and middle buttons all map to CGMouseButton::Center on macOS, which caused them to share a single pressed-state boolean and alias in double-click detection. Replace the ButtonState struct with a HashSet<u32> keyed by evdev button code so each button is tracked independently. --------- Co-authored-by: Ferdinand Schober <ferdinandschober20@gmail.com>