Working on a UWP project and previous answers like Properties.IsLeftButtonPressed / IsRightButtonPressed did not help me. These values ββare always false. During debugging, I realized that Properties.PointerUpdateKind changes depending on the mouse button. Here is the result that worked for me:
var properties = e.GetCurrentPoint(this).Properties; if (properties.PointerUpdateKind == Windows.UI.Input.PointerUpdateKind.LeftButtonReleased) { } else if (properties.PointerUpdateKind == Windows.UI.Input.PointerUpdateKind.RightButtonReleased) { } else if (properties.PointerUpdateKind == Windows.UI.Input.PointerUpdateKind.MiddleButtonReleased) { }
There are more options in PointerUpdateKind, such as the ButtonPressed options shown in the example, and XButton options, such as XButton1Pressed, XButton2Released, etc.
Antiqtech
source share