Пример #1
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);
        }
        /// <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 capabilitiesRef;

            ErrorCodeHelper
            .ToResult(xinput.XInputGetCapabilities((int)this.userIndex, deviceQueryType, out capabilitiesRef))
            .CheckError();
            return(capabilitiesRef);
        }
Пример #3
0
 /// <summary>
 /// Retrieves the capabilities and features of a connected controller.
 /// </summary>
 /// <param name="userIndex">Index of the user's controller. Can be a value in the range 0–3. </param>
 /// <param name="deviceQueryType">Type of the device query.</param>
 /// <param name="capabilities">The capabilities of this controller.</param>
 /// <returns>True if the controller is connected and succeed, false otherwise.</returns>
 public static bool GetCapabilities(int userIndex, DeviceQueryType deviceQueryType, out Capabilities capabilities)
 {
     return(s_xInput.XInputGetCapabilities(userIndex, deviceQueryType, out capabilities) == 0);
 }