A game framework written with osu! in mind.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix axis value potentially getting stuck non-zero

+5 -4
+5 -4
osu.Framework/Input/StateChanges/JoystickAxisInput.cs
··· 35 35 { 36 36 foreach (var a in Axes) 37 37 { 38 - // Not enough movement, don't fire event 39 - if (Precision.AlmostEquals(state.Joystick.AxesValues[(int)a.Source], a.Value)) 38 + float oldValue = state.Joystick.AxesValues[(int)a.Source]; 39 + 40 + // Not enough movement, don't fire event (unless returning to zero). 41 + if (oldValue == a.Value || (a.Value != 0 && Precision.AlmostEquals(oldValue, a.Value))) 40 42 continue; 41 43 42 - var lastValue = state.Joystick.AxesValues[(int)a.Source]; 43 44 state.Joystick.AxesValues[(int)a.Source] = a.Value; 44 - handler.HandleInputStateChange(new JoystickAxisChangeEvent(state, this, a, lastValue)); 45 + handler.HandleInputStateChange(new JoystickAxisChangeEvent(state, this, a, oldValue)); 45 46 } 46 47 } 47 48 }