mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-10-25 07:34:25 +00:00
Input: AvaloniaMouseDriver: fix native touch inputs (ryubing/ryujinx!178)
See merge request ryubing/ryujinx!178
This commit is contained in:
@@ -71,8 +71,8 @@ namespace Ryujinx.Ava.Input
|
|||||||
{
|
{
|
||||||
_size = new Size((int)rect.Width, (int)rect.Height);
|
_size = new Size((int)rect.Width, (int)rect.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleScrollStopped()
|
private void HandleScrollStopped()
|
||||||
{
|
{
|
||||||
Scroll = new Vector2(0, 0);
|
Scroll = new Vector2(0, 0);
|
||||||
}
|
}
|
||||||
@@ -104,12 +104,18 @@ namespace Ryujinx.Ava.Input
|
|||||||
}
|
}
|
||||||
private void Parent_PointerPressedEvent(object o, PointerPressedEventArgs args)
|
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)
|
if ((uint)PressedButtons.Length > button)
|
||||||
{
|
{
|
||||||
PressedButtons[button] = true;
|
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)
|
private void Parent_PointerMovedEvent(object o, PointerEventArgs args)
|
||||||
|
|||||||
Reference in New Issue
Block a user