Example #1
0
 /// <summary>
 /// Gets the Battery information.
 /// </summary>
 /// <param name="dwUserIndex">The Index.</param>
 /// <param name="devType">The DevType.</param>
 /// <param name="pBatteryInformation">The BatteryInformation.</param>
 /// <returns></returns>
 internal static int XInputGetBatteryInformation
 (
     int dwUserIndex,
     byte devType,
     ref XInputBatteryInformation pBatteryInformation
 )
 {
     return(0);
 }
            public static string GetBatteryType(PlayerIndex playerIndex)
            {
                string strReturn = "";

                XInputBatteryInformation gamepad = new XInputBatteryInformation();

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

                strReturn = gamepad.ToString();
                return(strReturn);
            }
Example #3
0
        private void UpdateBatteryState()
        {
            var headset = new XInputBatteryInformation();
            var gamepad = new XInputBatteryInformation();

            NativeMethods.XInputGetBatteryInformation(this.playerIndex, (byte)BatteryDeviceType.BATTERY_DEVTYPE_GAMEPAD, ref gamepad);
            NativeMethods.XInputGetBatteryInformation(this.playerIndex, (byte)BatteryDeviceType.BATTERY_DEVTYPE_HEADSET, ref headset);

            this.BatteryInformationHeadset = headset;
            this.BatteryInformationGamepad = gamepad;
        }
Example #4
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 #5
0
 /// <summary>
 /// Gets the Battery information.
 /// </summary>
 /// <param name="dwUserIndex">The Index.</param>
 /// <param name="devType">The DevType.</param>
 /// <param name="pBatteryInformation">The BatteryInformation.</param>
 /// <returns></returns>
 internal static int XInputGetBatteryInformation(int dwUserIndex, byte devType,
     ref XInputBatteryInformation pBatteryInformation)
 {
     return NativeMethods.XInputGetBatteryInformation(dwUserIndex, devType, ref pBatteryInformation);
 }
Example #6
0
 /// <summary>
 /// Gets the Battery information.
 /// </summary>
 /// <param name="dwUserIndex">The Index.</param>
 /// <param name="devType">The DevType.</param>
 /// <param name="pBatteryInformation">The BatteryInformation.</param>
 /// <returns></returns>
 internal static int XInputGetBatteryInformation(
     int dwUserIndex,
     byte devType,
     ref XInputBatteryInformation pBatteryInformation
     )
 {
     return 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
 );
Example #8
0
 public static extern int XInputGetBatteryInformation(int userIndex, byte devType, ref XInputBatteryInformation batteryInformation);
Example #9
0
 public static extern int XInputGetBatteryInformation14(int dwUserIndex, byte devType,
                                                        ref XInputBatteryInformation pBatteryInformation);
Example #10
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
 );
Example #11
0
            public static string GetBatteryType(PlayerIndex playerIndex)
            {
                string strReturn = "";

                XInputBatteryInformation gamepad = new XInputBatteryInformation();
                Imports.XInputGetBatteryInformation((int)playerIndex, (byte)0, ref gamepad);

                strReturn = gamepad.ToString();
                return strReturn;
            }
Example #12
0
 /// <summary>
 /// Gets the Battery information.
 /// </summary>
 /// <param name="dwUserIndex">The Index.</param>
 /// <param name="devType">The DevType.</param>
 /// <param name="pBatteryInformation">The BatteryInformation.</param>
 /// <returns></returns>
 internal static int XInputGetBatteryInformation(int dwUserIndex, byte devType,
                                                 ref XInputBatteryInformation pBatteryInformation)
 {
     return(NativeMethods.XInputGetBatteryInformation(dwUserIndex, devType, ref pBatteryInformation));
 }
Example #13
0
 public XInputGamePad()
 {
     batteryInfo = new XInputBatteryInformation();
     _state      = new XInputState();
 }