// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Input.States; using osuTK; namespace osu.Framework.Input.Events { /// /// An event representing a move of the mouse cursor. /// public class MouseMoveEvent : MouseEvent { /// /// The last mouse position before this mouse move in the screen space. /// public readonly Vector2 ScreenSpaceLastMousePosition; /// /// The last mouse position before this mouse move in local space. /// public Vector2 LastMousePosition => ToLocalSpace(ScreenSpaceLastMousePosition); /// /// The difference of mouse position from last position to current position in local space. /// public Vector2 Delta => MousePosition - LastMousePosition; public MouseMoveEvent(InputState state, Vector2? screenSpaceLastMousePosition = null) : base(state) { ScreenSpaceLastMousePosition = screenSpaceLastMousePosition ?? ScreenSpaceMousePosition; } } }