public void ReadState() { var inputState = new XINPUT_STATE(); _driver.GetState(_dwUserIndex, ref inputState); PreviousInputState = InputState; InputState = new InputState(inputState); if (PreviousInputState == null) { PreviousInputState = InputState; } var batteryInformation = new XINPUT_BATTERY_INFORMATION(); _driver.GetBatteryInformation(_dwUserIndex, _devType, ref batteryInformation); PreviousBatteryState = BatteryState; BatteryState = new BatteryState(batteryInformation); if (PreviousBatteryState == null) { PreviousBatteryState = BatteryState; } }
public static uint XInputGetBatteryInformation(uint dwUserIndex, byte devType, ref XINPUT_BATTERY_INFORMATION pBatteryInformation) { return OriginalXInputGetBatteryInformationFunction.Value(dwUserIndex, devType, ref pBatteryInformation); }
public static uint XInputGetBatteryInformation(uint dwUserIndex, byte devType, ref XINPUT_BATTERY_INFORMATION pBatteryInformation) { return(OriginalXInputGetBatteryInformationFunction.Value(dwUserIndex, devType, ref pBatteryInformation)); }
/// <summary> /// XInputGetBatteryInfomation /// https://msdn.microsoft.com/ja-jp/library/windows/desktop/microsoft.directx_sdk.reference.xinputgetbatteryinformation.aspx /// <summary> public static uint GetBatteryInformation(uint dwUserIndex, byte devType, ref XINPUT_BATTERY_INFORMATION pBatteryInformation) { return(funcXInputGetBatteryInformation(dwUserIndex, devType, ref pBatteryInformation)); }
public BatteryState(XINPUT_BATTERY_INFORMATION batteryInformation) { Type = Helper.EnumParse <BatteryType>(batteryInformation.BatteryType.ToString()); Level = Helper.EnumParse <BatteryLevel>(batteryInformation.BatteryLevel.ToString()); }
public static extern uint XInputGetBatteryInformation ( [In] uint dwUserIndex, // Index of the gamer associated with the device [In] byte devType, // Which device on this user index [Out] XINPUT_BATTERY_INFORMATION pBatteryInformation // Contains the level and types of batteries );