diff --git a/src/EngineSharp.Core/EngineSharp.Core/InputService.cs b/src/EngineSharp.Core/EngineSharp.Core/InputService.cs index a2b46d0..7cbe62d 100644 --- a/src/EngineSharp.Core/EngineSharp.Core/InputService.cs +++ b/src/EngineSharp.Core/EngineSharp.Core/InputService.cs @@ -86,14 +86,15 @@ public class InputService } var delta = _currentMousePosition.Value - newPosition; + _currentMousePosition = newPosition; - // TODO: Very very bad solution! I need to find a good way to determine if the cursor has left the window and now has re-entered it - if (Math.Abs(delta.X) <= 100 || Math.Abs(delta.Y) <= 100) + // TODO: Bad solution! I need to find a good way to determine if the cursor has left the window and now has re-entered it + if (delta.Length() > 50) { - _currentMouseDelta = new Vector2D(-delta.X, delta.Y); + return; } - _currentMousePosition = newPosition; + _currentMouseDelta = new Vector2D(-delta.X, delta.Y); } private void OnDeviceConnectionChanges(IInputDevice device, bool connected)