[PR #392] [MERGED] fix(macos): forward back/forward mouse buttons in capture and emulation #400

Closed
opened 2026-05-05 22:18:18 -06:00 by gitea-mirror · 0 comments
Owner

📋 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: mainHead: fix/macos-extra-mouse-buttons


📝 Commits (3)

  • 1c9f6d7 fix(macos): forward back/forward mouse buttons in capture and emulation
  • 83c889e fix(macos): track button state and double-clicks by evdev code instead of CGMouseButton
  • 821385b Merge 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.

## 📋 Pull Request Information **Original PR:** https://github.com/feschber/lan-mouse/pull/392 **Author:** [@tyvsmith](https://github.com/tyvsmith) **Created:** 2/19/2026 **Status:** ✅ Merged **Merged:** 2/22/2026 **Merged by:** [@feschber](https://github.com/feschber) **Base:** `main` ← **Head:** `fix/macos-extra-mouse-buttons` --- ### 📝 Commits (3) - [`1c9f6d7`](https://github.com/feschber/lan-mouse/commit/1c9f6d7415841ce7b0f3ef3eb5d3a6eb9d5d9475) fix(macos): forward back/forward mouse buttons in capture and emulation - [`83c889e`](https://github.com/feschber/lan-mouse/commit/83c889ebec08a11f87215401ab7a0ee69fa9bdb6) fix(macos): track button state and double-clicks by evdev code instead of CGMouseButton - [`821385b`](https://github.com/feschber/lan-mouse/commit/821385b2acb2b823506a959627e4a24764290e83) Merge branch 'main' into fix/macos-extra-mouse-buttons ### 📊 Changes **2 files changed** (+72 additions, -68 deletions) <details> <summary>View changed files</summary> 📝 `input-capture/src/macos.rs` (+17 -3) 📝 `input-emulation/src/macos.rs` (+55 -65) </details> ### 📄 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 22:18:18 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/lan-mouse#400
No description provided.