Ejemplo n.º 1
0
        /// <summary>
        ///   Gets the delta value of the given axis on the given device.
        /// </summary>
        /// <param name="dev">
        ///   The input device.
        /// </param>
        /// <param name="axis">
        ///   The axis to check.
        /// </param>
        /// <returns>
        ///   The delta value of the given axis on the given device if it is valid, otherwise 0.0f.
        /// </returns>
        public float GetAxisDelta(InputDevice dev, string axis)
        {
            if (dev is InputDevice.Mouse)
            {
                return(Mouse.AxisDelta(axis));
            }
            else if (dev is InputDevice.Joystick)
            {
                return(Joystick.AxisDelta(axis));
            }

            return(0.0f);
        }