public int XInputGetCapabilities(
     int dwUserIndex,
     DeviceQueryType dwFlags,
     out Capabilities capabilitiesRef)
 {
     return(XInput.XInputGetCapabilities(dwUserIndex, dwFlags, out capabilitiesRef));
 }
Esempio n. 2
0
        public Capabilities GetCapabilities(DeviceQueryType deviceQueryType)
        {
            Capabilities capabilitiesRef;

            ErrorCodeHelper.ToResult(XInput.XInputGetCapabilities((int)this.userIndex, deviceQueryType, out capabilitiesRef)).CheckError();
            return(capabilitiesRef);
        }
Esempio n. 3
0
        /// <summary>
        /// Gets the keystroke.
        /// </summary>
        /// <param name="deviceQueryType">The flag.</param>
        /// <param name="keystroke">The keystroke.</param>
        /// <returns></returns>
        /// <unmanaged>unsigned int XInputGetKeystroke([In] XUSER_INDEX dwUserIndex,[In] unsigned int dwReserved,[Out] XINPUT_KEYSTROKE* pKeystroke)</unmanaged>
        public Result GetKeystroke(DeviceQueryType deviceQueryType, out Keystroke keystroke)
        {
            var result = ErrorCodeHelper.ToResult(XInput.XInputGetKeystroke((int)userIndex, (int)deviceQueryType, out keystroke));

            result.CheckError();
            return(result);
        }
 public int XInputGetBatteryInformation(
     int dwUserIndex,
     BatteryDeviceType devType,
     out BatteryInformation batteryInformationRef)
 {
     return(XInput.XInputGetBatteryInformation(dwUserIndex, devType, out batteryInformationRef));
 }
Esempio n. 5
0
        public State GetState()
        {
            State stateRef;

            ErrorCodeHelper.ToResult(XInput.XInputGetState((int)this.userIndex, out stateRef)).CheckError();
            return(stateRef);
        }
Esempio n. 6
0
        /// <summary>
        /// Sets the vibration.
        /// </summary>
        /// <param name="vibration">The vibration.</param>
        /// <returns></returns>
        public Result SetVibration(Vibration vibration)
        {
            var result = ErrorCodeHelper.ToResult(XInput.XInputSetState((int)userIndex, vibration));

            result.CheckError();
            return(result);
        }
Esempio n. 7
0
        public BatteryInformation GetBatteryInformation(BatteryDeviceType batteryDeviceType)
        {
            BatteryInformation batteryInformationRef;

            ErrorCodeHelper.ToResult(XInput.XInputGetBatteryInformation((int)this.userIndex, batteryDeviceType, out batteryInformationRef)).CheckError();
            return(batteryInformationRef);
        }
Esempio n. 8
0
        /// <summary>
        /// Gets the state.
        /// </summary>
        /// <returns>The state of this controller.</returns>
        public State GetState()
        {
            State temp;
            var   result = ErrorCodeHelper.ToResult(XInput.XInputGetState((int)userIndex, out temp));

            result.CheckError();
            return(temp);
        }
Esempio n. 9
0
        /// <summary>
        /// Gets the battery information.
        /// </summary>
        /// <param name="batteryDeviceType">Type of the battery device.</param>
        /// <returns></returns>
        /// <unmanaged>unsigned int XInputGetBatteryInformation([In] XUSER_INDEX dwUserIndex,[In] BATTERY_DEVTYPE devType,[Out] XINPUT_BATTERY_INFORMATION* pBatteryInformation)</unmanaged>
        public BatteryInformation GetBatteryInformation(BatteryDeviceType batteryDeviceType)
        {
            BatteryInformation temp;
            var result = ErrorCodeHelper.ToResult(XInput.XInputGetBatteryInformation((int)userIndex, batteryDeviceType, out temp));

            result.CheckError();
            return(temp);
        }
Esempio n. 10
0
        /// <summary>
        /// Gets the capabilities.
        /// </summary>
        /// <param name="deviceQueryType">Type of the device query.</param>
        /// <returns></returns>
        /// <unmanaged>unsigned int XInputGetCapabilities([In] XUSER_INDEX dwUserIndex,[In] XINPUT_DEVQUERYTYPE dwFlags,[Out] XINPUT_CAPABILITIES* pCapabilities)</unmanaged>
        public Capabilities GetCapabilities(DeviceQueryType deviceQueryType)
        {
            Capabilities temp;
            var          result = ErrorCodeHelper.ToResult(XInput.XInputGetCapabilities((int)userIndex, deviceQueryType, out temp));

            result.CheckError();
            return(temp);
        }
Esempio n. 11
0
        public static unsafe int XInputGetCapabilities(int dwUserIndex, DeviceQueryType dwFlags, out Capabilities capabilitiesRef)
        {
            capabilitiesRef = new Capabilities();
            int capabilities;

            fixed(Capabilities *capabilitiesPtr = &capabilitiesRef)
            capabilities = XInput.XInputGetCapabilities_(dwUserIndex, (int)dwFlags, (void *)capabilitiesPtr);

            return(capabilities);
        }
Esempio n. 12
0
        public static unsafe int XInputGetState(int dwUserIndex, out State stateRef)
        {
            stateRef = new State();
            int state;

            fixed(State *statePtr = &stateRef)
            state = XInput.XInputGetState_(dwUserIndex, (void *)statePtr);

            return(state);
        }
Esempio n. 13
0
        public static unsafe int XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke keystrokeRef)
        {
            keystrokeRef = new Keystroke();
            int keystroke;

            fixed(Keystroke *keystrokePtr = &keystrokeRef)
            keystroke = XInput.XInputGetKeystroke_(dwUserIndex, dwReserved, (void *)keystrokePtr);

            return(keystroke);
        }
 public int XInputGetAudioDeviceIds(
     int dwUserIndex,
     IntPtr renderDeviceIdRef,
     IntPtr renderCountRef,
     IntPtr captureDeviceIdRef,
     IntPtr captureCountRef)
 {
     return(XInput.XInputGetAudioDeviceIds(dwUserIndex, renderDeviceIdRef, renderCountRef, captureDeviceIdRef,
                                           captureCountRef));
 }
Esempio n. 15
0
        public static unsafe int XInputGetBatteryInformation(int dwUserIndex, BatteryDeviceType devType, out BatteryInformation batteryInformationRef)
        {
            batteryInformationRef = new BatteryInformation();
            int batteryInformation;

            fixed(BatteryInformation *batteryInformationPtr = &batteryInformationRef)
            batteryInformation = XInput.XInputGetBatteryInformation_(dwUserIndex, (int)devType, (void *)batteryInformationPtr);

            return(batteryInformation);
        }
Esempio n. 16
0
        public static unsafe int XInputGetDSoundAudioDeviceGuids(int dwUserIndex, out Guid dSoundRenderGuidRef, out Guid dSoundCaptureGuidRef)
        {
            dSoundRenderGuidRef  = new Guid();
            dSoundCaptureGuidRef = new Guid();
            int audioDeviceGuids;

            fixed(Guid *guidPtr1 = &dSoundRenderGuidRef)
            fixed(Guid * guidPtr2 = &dSoundCaptureGuidRef)
            audioDeviceGuids      = XInput.XInputGetDSoundAudioDeviceGuids_(dwUserIndex, (void *)guidPtr1, (void *)guidPtr2);

            return(audioDeviceGuids);
        }
Esempio n. 17
0
 public int XInputGetKeystroke(int dwUserIndex, int dwReserved, out Keystroke keystrokeRef)
 {
     return(XInput.XInputGetKeystroke(dwUserIndex, dwReserved, out keystrokeRef));
 }
Esempio n. 18
0
 public void XInputEnable(RawBool enable)
 {
     XInput.XInputEnable(enable);
 }
Esempio n. 19
0
 public int XInputGetState(int dwUserIndex, out State stateRef)
 {
     return(XInput.XInputGetState(dwUserIndex, out stateRef));
 }
Esempio n. 20
0
 public int XInputSetState(int dwUserIndex, Vibration vibrationRef)
 {
     return(XInput.XInputSetState(dwUserIndex, ref vibrationRef));
 }
Esempio n. 21
0
 public static void XInputEnable(Bool enable)
 {
     XInput.XInputEnable_(enable);
 }
Esempio n. 22
0
 /// <summary>
 /// Gets the capabilities.
 /// </summary>
 /// <param name="deviceQueryType">Type of the device query.</param>
 /// <param name="capabilities">The capabilities of this controller.</param>
 /// <returns><c>true</c> if the controller is connected, <c>false</c> otherwise.</returns>
 public bool GetCapabilities(DeviceQueryType deviceQueryType, out Capabilities capabilities)
 {
     return(XInput.XInputGetCapabilities((int)userIndex, deviceQueryType, out capabilities) == 0);
 }
Esempio n. 23
0
 public static unsafe int XInputSetState(int dwUserIndex, Vibration vibrationRef)
 {
     return(XInput.XInputSetState_(dwUserIndex, (void *)&vibrationRef));
 }
Esempio n. 24
0
 /// <summary>
 /// Gets the state.
 /// </summary>
 /// <param name="state">The state of this controller.</param>
 /// <returns><c>true</c> if the controller is connected, <c>false</c> otherwise.</returns>
 public bool GetState(out State state)
 {
     return(XInput.XInputGetState((int)userIndex, out state) == 0);
 }
Esempio n. 25
0
 /// <summary>
 /// Sets the reporting.
 /// </summary>
 /// <param name="enableReporting">if set to <c>true</c> [enable reporting].</param>
 public static void SetReporting(bool enableReporting)
 {
     XInput.XInputEnable(enableReporting);
 }