/// <summary> /// Get the value of an analog mouse button /// </summary> /// <param name="btn">Analog button</param> /// <returns>Return the value of the button</returns> public static float GetValue(MouseAnalogButtons btn) { float result = 0.0f; switch (btn) { case MouseAnalogButtons.MouseX: result = _currentPosition.X; break; case MouseAnalogButtons.MouseY: result = _currentPosition.Y; break; case MouseAnalogButtons.MouseWheel: result = _currentState.ScrollWheelValue; break; } return result; }
/// <summary> /// Constructor of AbstractButton struct /// </summary> /// <param name="button">Underlying button</param> public AbstractButton(MouseAnalogButtons button) { Device = InputDevice.Mouse; Type = ButtonType.Analog; ButtonCode = (int)button; }
/// <summary> /// Get the delta value of an anlog mouse button /// </summary> /// <param name="btn">Analog button</param> /// <returns>Return the delta value of the button</returns> public static float GetDeltaValue(MouseAnalogButtons btn) { float result = 0.0f; switch (btn) { case MouseAnalogButtons.MouseX: result = _positionDelta.X; break; case MouseAnalogButtons.MouseY: result = _positionDelta.Y; break; case MouseAnalogButtons.MouseWheel: result = WheelDelta; break; } return result; }