fix(macos): correct right and middle mouse drag handling - #95
Open
mkrusen wants to merge 1 commit into
Open
Conversation
|
Member
|
@mkrusen thank you for the PR! Could you please review and sign the CLA? #95 (comment) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Fixes macOS right and middle mouse drag handling in the CoreGraphics mouse backend.
I encountered an issue while using Sunshine as a macOS host with Moonlight as the client where a normal right-click worked, but holding the right mouse button while moving the mouse did not behave correctly.
The macOS backend tracks mouse button state with index 0 as left, 1 as right, and 2 as middle. However,
event_type_for_current_buttons()mapped the right button tokCGEventOtherMouseDraggedand the middle button tokCGEventRightMouseDragged.This change corrects those mappings so that:
kCGEventRightMouseDraggedkCGEventOtherMouseDraggedIt also adds selection of the currently held mouse button for relative and absolute mouse movement. Previously these movement events always passed
kCGMouseButtonLefttopost_mouse(), even when the right or middle button was being held.I tested the change using Sunshine on macOS with Moonlight as the client. Before the change, right-click worked but right-click-and-hold with mouse movement did not work correctly.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
See our AI usage policy.