fix Mouse.Wheel calculation
parent
ea86212199
commit
59190e619d
|
@ -197,7 +197,7 @@ namespace MoonWorks
|
|||
break;
|
||||
|
||||
case SDL.SDL_EventType.SDL_MOUSEWHEEL:
|
||||
Inputs.Mouse.Wheel += _event.wheel.y;
|
||||
Inputs.Mouse.WheelRaw += _event.wheel.y;
|
||||
break;
|
||||
|
||||
case SDL.SDL_EventType.SDL_DROPBEGIN:
|
||||
|
|
|
@ -37,7 +37,6 @@ namespace MoonWorks.Input
|
|||
AnyPressed = false;
|
||||
AnyPressedButton = default; // DeviceKind.None
|
||||
|
||||
Mouse.Wheel = 0;
|
||||
Keyboard.Update();
|
||||
|
||||
if (Keyboard.AnyPressed)
|
||||
|
|
|
@ -14,7 +14,10 @@ namespace MoonWorks.Input
|
|||
public int DeltaX { get; private set; }
|
||||
public int DeltaY { get; private set; }
|
||||
|
||||
public int Wheel { get; internal set; }
|
||||
// note that this is a delta value
|
||||
public int Wheel { get; private set; }
|
||||
internal int WheelRaw;
|
||||
private int previousWheelRaw = 0;
|
||||
|
||||
public bool AnyPressed { get; private set; }
|
||||
public MouseButton AnyPressedButton { get; private set; }
|
||||
|
@ -74,6 +77,9 @@ namespace MoonWorks.Input
|
|||
DeltaX = deltaX;
|
||||
DeltaY = deltaY;
|
||||
|
||||
Wheel = WheelRaw - previousWheelRaw;
|
||||
previousWheelRaw = WheelRaw;
|
||||
|
||||
LeftButton.Update();
|
||||
MiddleButton.Update();
|
||||
RightButton.Update();
|
||||
|
|
Loading…
Reference in New Issue