public static string GetBatteryType(PlayerIndex playerIndex) { var gamepad = new XInputBatteryInformation(); Imports.XInputGetBatteryInformation((int)playerIndex, 0, ref gamepad); return(gamepad.ToString()); }
public static extern 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 );