From b1f767b2d51559feec627ae5c11ba3bb0efab9a9 Mon Sep 17 00:00:00 2001 From: Xam <87-xam@users.noreply.git.ryujinx.app> Date: Mon, 20 Oct 2025 00:33:24 +0200 Subject: [PATCH] Input: AvaloniaMouseDriver: fix native touch inputs --- src/Ryujinx/Input/AvaloniaMouseDriver.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx/Input/AvaloniaMouseDriver.cs b/src/Ryujinx/Input/AvaloniaMouseDriver.cs index 564307bbd..556cabb2c 100644 --- a/src/Ryujinx/Input/AvaloniaMouseDriver.cs +++ b/src/Ryujinx/Input/AvaloniaMouseDriver.cs @@ -70,8 +70,8 @@ namespace Ryujinx.Ava.Input { _size = new Size((int)rect.Width, (int)rect.Height); } - - private void HandleScrollStopped() + + private void HandleScrollStopped() { Scroll = new Vector2(0, 0); } @@ -103,12 +103,18 @@ namespace Ryujinx.Ava.Input } private void Parent_PointerPressedEvent(object o, PointerPressedEventArgs args) { - uint button = (uint)args.GetCurrentPoint(_widget).Properties.PointerUpdateKind; + PointerPoint currentPoint = args.GetCurrentPoint(_widget); + uint button = (uint)currentPoint.Properties.PointerUpdateKind; if ((uint)PressedButtons.Length > button) { PressedButtons[button] = true; } + + if (args.Pointer.Type == PointerType.Touch) // mouse position is unchanged for touch events, set touch position + { + CurrentPosition = new Vector2((float)currentPoint.Position.X, (float)currentPoint.Position.Y); + } } private void Parent_PointerMovedEvent(object o, PointerEventArgs args)