mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-05-15 06:06:07 -06:00
[PR #392] [MERGED] fix(macos): forward back/forward mouse buttons in capture and emulation #400
Labels
No labels
Xorg
documentation
enhancement
macos
pull-request
question
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/lan-mouse#400
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/feschber/lan-mouse/pull/392
Author: @tyvsmith
Created: 2/19/2026
Status: ✅ Merged
Merged: 2/22/2026
Merged by: @feschber
Base:
main← Head:fix/macos-extra-mouse-buttons📝 Commits (3)
1c9f6d7fix(macos): forward back/forward mouse buttons in capture and emulation83c889efix(macos): track button state and double-clicks by evdev code instead of CGMouseButton821385bMerge branch 'main' into fix/macos-extra-mouse-buttons📊 Changes
2 files changed (+72 additions, -68 deletions)
View changed files
📝
input-capture/src/macos.rs(+17 -3)📝
input-emulation/src/macos.rs(+55 -65)📄 Description
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.
Verified on Hyprland Arch host running the latest main build, and macOS Tahoe 26.2 as the client.
Fixes #391
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.