feat: Recognize secondary button pointer events#1989
Conversation
|
Hi Owen, I think it's better to define different event types for the secondary events (instead of adding a flag inside the current events). So I just suggest defining new event types for secondary events, then anyone can support the secondary button, and the current implementation remains untouched. Thanks! |
|
Hey @imaNNeo I have updated the PR as you suggested 🙂 |
|
Perfect! Thanks for implementing the new approach.
|
|
@imaNNeo I have updated the code as you suggested. As there do not exist any tests for other events currently I am not sure if I find the time to write them. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1989 +/- ##
=======================================
Coverage 93.00% 93.00%
=======================================
Files 50 50
Lines 3917 3917
=======================================
Hits 3643 3643
Misses 274 274
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for your contribution! |
This pull request adds support for distinguishing between primary and secondary button interactions in chart touch events. The main changes involve creating special
secondaryevent classes and wiring up the appropriate gesture recognizer callbacks to handle secondary button events.Touch event model enhancements:
secondarytouch event classes (FlTapDownSecondaryEvent,FlTapCancelSecondaryEvent,FlTapUpSecondaryEvent,FlLongPressSecondaryStart,FlLongPressMoveSecondaryUpdate,FlLongPressSecondaryEnd) infl_touch_event.dartto indicate if the event was triggered by a secondary button.Gesture recognizer integration:
render_base_chart.dartto handle secondary tap and long press gestures by wiring up the corresponding gesture recognizer callbacks.These changes enable the chart to differentiate between primary and secondary pointer interactions, which is useful for supporting right-click or other alternate input methods.