コード例 #1
0
        public static string GetBatteryType(PlayerIndex playerIndex)
        {
            var gamepad = new XInputBatteryInformation();

            Imports.XInputGetBatteryInformation((int)playerIndex, 0, ref gamepad);

            return(gamepad.ToString());
        }
コード例 #2
0
 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
 );