mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-03 05:51:06 +00:00
Use new axis querying functions to update mouse scroll state.
This commit is contained in:
parent
72f1e433b4
commit
a7ca0921df
|
@ -485,21 +485,15 @@ namespace OpenTK.Platform.Linux
|
|||
{
|
||||
mouse.State.SetIsConnected(true);
|
||||
|
||||
double value = e.AxisValue;
|
||||
PointerAxis axis = e.Axis;
|
||||
switch (axis)
|
||||
if (e.HasAxis(PointerAxis.HorizontalScroll))
|
||||
{
|
||||
case PointerAxis.HorizontalScroll:
|
||||
mouse.State.SetScrollRelative((float)value, 0);
|
||||
break;
|
||||
|
||||
case PointerAxis.VerticalScroll:
|
||||
mouse.State.SetScrollRelative(0, (float)value);
|
||||
break;
|
||||
|
||||
default:
|
||||
Debug.Print("[Input] Unknown scroll axis {0}.", axis);
|
||||
break;
|
||||
mouse.State.SetScrollRelative((float)e.AxisValue(PointerAxis.HorizontalScroll), 0);
|
||||
}
|
||||
if (e.HasAxis(PointerAxis.VerticalScroll))
|
||||
{
|
||||
Debug.Print(e.AxisValue(PointerAxis.VerticalScroll));
|
||||
mouse.State.SetScrollRelative(0, (float)e.AxisValue(PointerAxis.VerticalScroll));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue