Esempio n. 1
0
        public XInputCapabilities GetCapabilities()
        {
            XInputCapabilities capabilities = new XInputCapabilities();

            XInput.XInputGetCapabilities(_playerIndex, XInputConstants.XINPUT_FLAG_GAMEPAD, ref capabilities);
            return(capabilities);
        }
Esempio n. 2
0
 public static int XInputGetCapabilities(
     int dwUserIndex, // [in] Index of the gamer associated with the device
     int dwFlags, // [in] Input flags that identify the device type
     ref XInputCapabilities pCapabilities // [out] Receives the capabilities
     )
 {
     return IsWin8OrNewer ? XInput14.XInputGetCapabilities(dwUserIndex, dwFlags, ref pCapabilities) : XInput910.XInputGetCapabilities(dwUserIndex, dwFlags, ref pCapabilities);
 }
Esempio n. 3
0
 public static int XInputGetCapabilities
 (
     int dwUserIndex,                     // [in] Index of the gamer associated with the device
     int dwFlags,                         // [in] Input flags that identify the device type
     ref XInputCapabilities pCapabilities // [out] Receives the capabilities
 )
 {
     return(IsWin8OrNewer ? XInput14.XInputGetCapabilities(dwUserIndex, dwFlags, ref pCapabilities) : XInput910.XInputGetCapabilities(dwUserIndex, dwFlags, ref pCapabilities));
 }
Esempio n. 4
0
        public void UpdateState()
        {
            XInputCapabilities X = new XInputCapabilities();
            int result           = XInput.XInputGetState(_playerIndex, ref gamepadStateCurrent);

            IsConnected = (result == 0);

            UpdateBatteryState();
            if (gamepadStateCurrent.PacketNumber != gamepadStatePrev.PacketNumber)
            {
                OnStateChanged();
            }
            gamepadStatePrev.Copy(gamepadStateCurrent);

            if (_stopMotorTimerActive && (DateTime.Now >= _stopMotorTime))
            {
                XInputVibration stopStrength = new XInputVibration()
                {
                    LeftMotorSpeed = 0, RightMotorSpeed = 0
                };
                XInput.XInputSetState(_playerIndex, ref stopStrength);
            }
        }
Esempio n. 5
0
 internal static extern int XInputGetCapabilities
 (
     int dwUserIndex,                     // [in] Index of the gamer associated with the device
     int dwFlags,                         // [in] Input flags that identify the device type
     ref XInputCapabilities pCapabilities // [out] Receives the capabilities
 );
Esempio n. 6
0
 public static extern int XInputGetCapabilities(
     int dwUserIndex, // [in] Index of the gamer associated with the device
     int dwFlags, // [in] Input flags that identify the device type
     ref XInputCapabilities pCapabilities // [out] Receives the capabilities
     );
Esempio n. 7
0
 public int GetCapabilities(int dwUserIndex, int dwFlags, ref XInputCapabilities pCapabilities)
 {
     switch (dllIndex)
     {
         case 0:
             return XInputGetCapabilities14(dwUserIndex, dwFlags, ref pCapabilities);
         case 1:
             return XInputGetCapabilities13(dwUserIndex, dwFlags, ref pCapabilities);
         case 2:
             return XInputGetCapabilities9(dwUserIndex, dwFlags, ref pCapabilities);
         default:
             return 0;
     }
 }
Esempio n. 8
0
 private static extern int XInputGetCapabilities9(int dwUserIndex, int dwFlags,
     ref XInputCapabilities pCapabilities);