Пример #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);
 }
Пример #2
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);
            }
Пример #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;
        }
Пример #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);
            }
        }
Пример #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);
 }
Пример #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;
 }
Пример #7
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
 );
Пример #8
0
 public static extern int XInputGetBatteryInformation(int userIndex, byte devType, ref XInputBatteryInformation batteryInformation);
Пример #9
0
 public static extern int XInputGetBatteryInformation14(int dwUserIndex, byte devType,
                                                        ref XInputBatteryInformation pBatteryInformation);
Пример #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
 );
Пример #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;
            }
Пример #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));
 }
Пример #13
0
 public XInputGamePad()
 {
     batteryInfo = new XInputBatteryInformation();
     _state      = new XInputState();
 }