Browse Source
Merge pull request #5742 from SutandoTsukai181/xbutton
Add missing XButtons 1 and 2 to MouseButton
pull/5758/head
Nikita Tsukanov
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
7 additions and
1 deletions
-
src/Avalonia.Input/PointerEventArgs.cs
-
src/Avalonia.Input/PointerPoint.cs
|
|
|
@ -107,7 +107,9 @@ namespace Avalonia.Input |
|
|
|
None, |
|
|
|
Left, |
|
|
|
Right, |
|
|
|
Middle |
|
|
|
Middle, |
|
|
|
XButton1, |
|
|
|
XButton2 |
|
|
|
} |
|
|
|
|
|
|
|
public class PointerPressedEventArgs : PointerEventArgs |
|
|
|
|
|
|
|
@ -90,6 +90,10 @@ namespace Avalonia.Input |
|
|
|
return MouseButton.Middle; |
|
|
|
if (kind == PointerUpdateKind.RightButtonPressed || kind == PointerUpdateKind.RightButtonReleased) |
|
|
|
return MouseButton.Right; |
|
|
|
if (kind == PointerUpdateKind.XButton1Pressed || kind == PointerUpdateKind.XButton1Released) |
|
|
|
return MouseButton.XButton1; |
|
|
|
if (kind == PointerUpdateKind.XButton2Pressed || kind == PointerUpdateKind.XButton2Released) |
|
|
|
return MouseButton.XButton2; |
|
|
|
return MouseButton.None; |
|
|
|
} |
|
|
|
} |
|
|
|
|