Added support for multiple mouse button events #8480
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.
This PR adds support for multiple mouse button events, fixing issue #3597
The PR also adds some documentation for how the mouse multi-touch simulation works.
Implementation note: The original implementation used a variable, self.current_drag to hold the current touch. This limited the behavior to only work correctly when one button was pressed at a time. In multi-touch simulation is this not an issue as the buttons have predefined roles. When multi-touch simulation is disabled this did not allow multiple buttons to be used simultaneously. This fix changes self.curent_drag to a dictionary, and holds a touch per button. In the case that multi-touch simulation is enabled, a single key is used to access the self.current_drag dict, retaining the original behavior.
When multi-touch simulation is disabled. Each mouse button will properly report their button up/down state changes. If the mouse is dragged with multiple buttons pressed there will be an on_touch_move message for each button.
Maintainer merge checklist
Component: xxx
label.api-deprecation
orapi-break
label.release-highlight
label to be highlighted in release notes.versionadded
,versionchanged
as needed.