Fix stylus hover button handling - #1246
Open
CodeDoctorDE wants to merge 1 commit into
Open
CodeDoctorDE wants to merge 1 commit into
CodeDoctorDE wants to merge 1 commit into
Conversation
1 task
CodeDoctorDE
force-pushed
the
develop
branch
from
September 4, 2026 11:39
c769440 to
efe1af6
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The merged stylus button state is not propagated to shortcut detection and handler callbacks that still observe the raw event.buttons, leaving the fix incomplete for stylus shortcuts/consumers.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR aims to fix stylus barrel-button handling by preserving stylus hover button state and merging it into subsequent pointer-down handling so stylus button presses can be recognized even when PointerDownEvent.buttons is reported as 0.
Changes:
- Added
mergeStylusButtonStatehelper to combine stylus hover button state with pointer-down button state. - Tracked stylus hover button state per device and used it to compute an “effective buttons” mask on pointer down.
- Routed
onPointerHoverthrough the input coordinator and added a unit test validating the merge behavior.
File summaries
| File | Description |
|---|---|
| app/test/services/pointer_shortcuts_test.dart | Adds unit test coverage for mergeStylusButtonState. |
| app/lib/views/view/input.dart | Tracks stylus hover button state and merges it into pointer-down button handling. |
| app/lib/views/view/content.dart | Delegates hover events to the input coordinator for centralized handling. |
| app/lib/cubits/settings.dart | Introduces mergeStylusButtonState utility used by input handling (and tested). |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
76
to
+80
| _pointerKinds[event.pointer] = event.kind; | ||
| final effectiveButtons = mergeStylusButtonState( | ||
| kind: event.kind, | ||
| eventButtons: event.buttons, | ||
| hoverButtons: _stylusHoverButtonState[event.device] ?? 0, |
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.
No description provided.