// 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.Extensions.TypeExtensions; using osu.Framework.Input.States; using osuTK; namespace osu.Framework.Input.Events { /// /// An event representing a change of the mouse wheel. /// public class ScrollEvent : MouseEvent { /// /// The relative change in scroll associated with this event. /// public readonly Vector2 ScrollDelta; /// /// Whether the change came from a device supporting precision scrolling. /// /// /// In cases this is true, scroll events will generally map 1:1 to user's input, rather than incrementing in large "notches" (as expected of traditional scroll wheels). /// public readonly bool IsPrecise; public ScrollEvent(InputState state, Vector2 scrollDelta, bool isPrecise = false) : base(state) { ScrollDelta = scrollDelta; IsPrecise = isPrecise; } public override string ToString() => $"{GetType().ReadableName()}({ScrollDelta}, {IsPrecise})"; } }