dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.75k forks source link

Differentiate Left/Right click in PointerGestureRecognizer #24666

Open cdecron opened 2 months ago

cdecron commented 2 months ago

Description

Hello,

PointerGestureRecognizer doesn't provide any parameter to detect if it's a left or right click. To detect left/right click, we need to use TapGestureRecognizer, which provides Buttons parameter, however TapGestureRecognizer doesn't allow to detect pointer down, it only detects pointer up with its event Tapped.

Thus, what is need is PointerGestureRecognizer which allows to detect left/right click, or a TapGestureRecognizer which allows to detect pointer down.

Thank you

(this is a duplicate of this topic which has been closed whereas problem is not solved)

Public API Changes

PointerGestureRecognizer pointerGestureHandler = new PointerGestureRecognizer();
pointerGestureHandler.Buttons = ButtonsMask.Primary;

Intended Use-Case

In my app, user can do different actions when clicking down, moving pointer and clicking up, and thesse actions must be different for each mouse buttons. However, with PointerGestureRecognizer I can't specifiy which mouse button is doing the action.

github-actions[bot] commented 2 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.