Example #1
0
 //this function is not available prior to Windows 8
 public static int XInputGetBatteryInformation(
     int dwUserIndex, // Index of the gamer associated with the device
     byte devType, // Which device on this user index
     ref XInputBatteryInformation pBatteryInformation // Contains the level and types of batteries
     )
 {
     return IsWin8OrNewer ? XInput14.XInputGetBatteryInformation(dwUserIndex, devType, ref pBatteryInformation) : XInput910.XInputGetBatteryInformation(dwUserIndex, devType, ref pBatteryInformation);
 }
Example #2
0
 //this function is not available prior to Windows 8
 public static int XInputGetBatteryInformation(
     int dwUserIndex, // Index of the gamer associated with the device
     byte devType, // Which device on this user index
     ref XInputBatteryInformation pBatteryInformation // Contains the level and types of batteries
     )
 {
     return 0;
 }
Example #3
0
        public void UpdateBatteryState()
        {
            var gamepad = new XInputBatteryInformation();

            _xInput.GetBatteryInformation(_playerIndex, (byte)BatteryDeviceType.BATTERY_DEVTYPE_GAMEPAD, ref gamepad);

            BatteryInformationGamepad = gamepad;
        }
Example #4
0
 //this function is not available prior to Windows 8
 public static int XInputGetBatteryInformation
 (
     int dwUserIndex,                                 // Index of the gamer associated with the device
     byte devType,                                    // Which device on this user index
     ref XInputBatteryInformation pBatteryInformation // Contains the level and types of batteries
 )
 {
     return(0);
 }
Example #5
0
 //this function is not available prior to Windows 8
 public static int XInputGetBatteryInformation
 (
     int dwUserIndex,                                 // Index of the gamer associated with the device
     byte devType,                                    // Which device on this user index
     ref XInputBatteryInformation pBatteryInformation // Contains the level and types of batteries
 )
 {
     return(IsWin8OrNewer ? XInput14.XInputGetBatteryInformation(dwUserIndex, devType, ref pBatteryInformation) : XInput910.XInputGetBatteryInformation(dwUserIndex, devType, ref pBatteryInformation));
 }
Example #6
0
        public void UpdateBatteryState()
        {
            XInputBatteryInformation headset = new XInputBatteryInformation(),
                                     gamepad = new XInputBatteryInformation();

            XInput.XInputGetBatteryInformation(_playerIndex, (byte)BatteryDeviceType.BATTERY_DEVTYPE_GAMEPAD, ref gamepad);
            XInput.XInputGetBatteryInformation(_playerIndex, (byte)BatteryDeviceType.BATTERY_DEVTYPE_HEADSET, ref headset);

            BatteryInformationHeadset = headset;
            BatteryInformationGamepad = gamepad;
        }
Example #7
0
 public int GetBatteryInformation(int dwUserIndex, byte devType, ref XInputBatteryInformation pBatteryInformation)
 {
     switch (dllIndex)
     {
         case 0:
             return XInputGetBatteryInformation14(dwUserIndex, devType, ref pBatteryInformation);
         case 1:
             return XInputGetBatteryInformation13(dwUserIndex, devType, ref pBatteryInformation);
         default:
             return -1;
     }
 }
Example #8
0
 public static extern int XInputGetBatteryInformation14(int dwUserIndex, byte devType,
     ref XInputBatteryInformation pBatteryInformation);