如何检测PointerReleased事件中释放的鼠标按钮。 [英] How to detect which mouse button is released in PointerReleased event.

查看:81
本文介绍了如何检测PointerReleased事件中释放的鼠标按钮。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够在PointerPressed事件中检测到按下了哪个鼠标按钮。

I am able to detect which mouse button is pressed in PointerPressed event through.

PointerEventArgs.GetCurrentPoint()。Properties.IsLeftButtonPressed,IsRightButtonPressed,IsMiddleButtonPressed。

PointerEventArgs.GetCurrentPoint().Properties.IsLeftButtonPressed, IsRightButtonPressed, IsMiddleButtonPressed.

但PointerReleased中的这些属性将为false。因此,无法确定释放哪个鼠标按钮。 

But these properties will be false in PointerReleased. So, unable to determine which mouse button is released. 

注意:我不希望在按下状态(解决方法)期间维护任何私有属性。因为它不适合我的应用。

Note: I dont want any private properties to be maintained during pressed state (workaround). Because it is not suitable in my app.

- Jegan

- Jegan

推荐答案

指针事件通常用于单输入(例如,触摸)交互。虽然有详细说明当前按下哪些按钮的属性,但这些属性是PointerPointProperties类的属性,并且可能与引发的特定
事件无直接关系。你想要完成什么?
Pointer events are typically used for single-input (e.g., touch) interactions. While there are properties detailing which buttons are currently pressed, those are properties of the PointerPointProperties class and may not directly relate to a particular event being raised. What are you trying to accomplish?


这篇关于如何检测PointerReleased事件中释放的鼠标按钮。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆