浏览代码

Ava: Fix wrong MouseButton (#4900)

Ac_K 2 年之前
父节点
当前提交
2b6e81deea
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      src/Ryujinx.Ava/Input/AvaloniaMouseDriver.cs

+ 7 - 4
src/Ryujinx.Ava/Input/AvaloniaMouseDriver.cs

@@ -70,11 +70,14 @@ namespace Ryujinx.Ava.Input
 
 
         private void Parent_PointerReleaseEvent(object o, PointerReleasedEventArgs args)
         private void Parent_PointerReleaseEvent(object o, PointerReleasedEventArgs args)
         {
         {
-            int button = (int)args.InitialPressMouseButton - 1;
-
-            if (PressedButtons.Count() >= button)
+            if (args.InitialPressMouseButton != Avalonia.Input.MouseButton.None)
             {
             {
-                PressedButtons[button] = false;
+                int button = (int)args.InitialPressMouseButton;
+
+                if (PressedButtons.Count() >= button)
+                {
+                    PressedButtons[button] = false;
+                }
             }
             }
         }
         }