コード例 #1
0
ファイル: Mouse.cs プロジェクト: Julien-Pires/Pulsar
        /// <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;
        }
コード例 #2
0
ファイル: AbstractButton.cs プロジェクト: Julien-Pires/Pulsar
 /// <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;
 }
コード例 #3
0
ファイル: Mouse.cs プロジェクト: Julien-Pires/Pulsar
        /// <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;
        }