You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TapRegion should detect right click or middle button click #136706
I am currently having difficulties to detect if a mouse right click or mouse middle click has happened outside of a widget. This is really necessary to display a custom menus in a desktop application.
Currently, TapRegion widget only detects left mouse click for onTapInside and onTapOutside. Thus, there is no way currently to detect if a right click or middle click event has happened outside of the region of a widget. On the other-hand, GestureDetector can detect right click etc but no way to detect if the click has happened outside of the GestureDetector.
Proposal
It would be really nice to have TapRegion detect all kinds of mouse button click event.
The mentioned proposal handles a different aspect of TapRegion, to extend the region in case of a dropdown. But my proposal is a bit different.
I am mostly looking for the ability to detect right, middle mouse click inside and outside of TapRegion. Currently TapRegion only respond to left mouse click. It doesn't have the ability to detect any other mouse button click.
Let me know if you need more info or clarification.
It sounds like a reasonable use case. I encourage you to submit a PR to add it. :)
We typically define a minimal feature set when we first design a widget (as in the case of TapRegion, only the primary button callbacks but not the other buttons), and wait until a reasonable use case report to add more.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
dam-ease commentedon Oct 17, 2023
Hi @anidotnet. Thanks for proposing this. I see there is an open proposal similar to yours #128317. Can you check this out?
anidotnet commentedon Oct 17, 2023
The mentioned proposal handles a different aspect of TapRegion, to extend the region in case of a dropdown. But my proposal is a bit different.
I am mostly looking for the ability to detect right, middle mouse click inside and outside of TapRegion. Currently TapRegion only respond to left mouse click. It doesn't have the ability to detect any other mouse button click.
Let me know if you need more info or clarification.
dkwingsmt commentedon Oct 17, 2023
It sounds like a reasonable use case. I encourage you to submit a PR to add it. :)
We typically define a minimal feature set when we first design a widget (as in the case of
TapRegion, only the primary button callbacks but not the other buttons), and wait until a reasonable use case report to add more.anidotnet commentedon Oct 18, 2023
@dkwingsmt I have submitted the PR and waiting for the review.
anidotnet commentedon Nov 30, 2023
@HansMuller @dkwingsmt I have updated the PR #136799 as requested. Could you please provide a timeline when this can be merged?
dkwingsmt commentedon Nov 30, 2023
Sorry for missing your update. Approved!
Enable TapRegion to detect all mouse button click (#136799)
github-actions commentedon Dec 20, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.