using Chernobyl.Collections.Generic.Event; using Chernobyl.Input.Controls; using Chernobyl.Input.Controls.Axis; using Chernobyl.Mathematics.Mechanics; namespace Chernobyl.Input.Xna.Controls.Mouse { /// /// Represents the scroll wheel on a mouse device. /// public class MouseScrollWheel : AxisControl { /// /// Constructor. /// /// The services to inject into this control and /// it's children. /// The mouse that this mouse position belongs to. public MouseScrollWheel(IEventCollection services, IMouse mouse) : base(services) { Name = "ScrollWheel"; MakeParentChild(mouse, this); } /// /// The amount of change, from the axis' /// to its . Implementors should return /// the raw change amount and not try to apply /// to the returned value. The /// class will apply the /// value for you. /// protected override float OverridableChangeAmount { get { return Microsoft.Xna.Framework.Input.Mouse.GetState().ScrollWheelValue - PreviousValue; } } } }