Input: AvaloniaMouseDriver: fix native touch inputs

This commit is contained in:
Xam 2025-10-20 00:33:24 +02:00 committed by KeatonTheBot
parent ec9713b111
commit b1f767b2d5

View file

@ -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)