Esempio n. 1
0
        static Int32 XInputGetCapabilities_Hooked(Int32 dwUserIndex, Int32 dwFlags, out SharpDX.XInput.Capabilities caps)
        {
            Int32 ret = 0;

            try
            {
                XInputHook This = (XInputHook)HookRuntimeInfo.Callback;
                ret = XInputGetCapabilities(dwUserIndex, dwFlags, out caps);
                //This.Interface.Notify(String.Format("Called XInputGetCapabilities index {0} flags {1} ret {2} caps {3}", dwUserIndex, dwFlags, caps));
            }
            catch { caps = new SharpDX.XInput.Capabilities(); }
            return(ret);
        }
Esempio n. 2
0
        /// <summary>
        /// <p>Retrieves the capabilities and features of a connected controller.</p>
        /// </summary>
        /// <param name="dwUserIndex"><dd> <p>Index of the user's controller. Can be a value in the range 0?3. For information about how this value is determined and how the value maps to indicators on the controller, see Multiple Controllers. </p> </dd></param>
        /// <param name="dwFlags"><dd> <p>Input flags that identify the controller type. If this value is 0, then the capabilities of all controllers connected to the system are returned. Currently, only one value is supported: </p> <table> <tr><th>Value</th><th>Description</th></tr> <tr><td><strong><see cref="SharpDX.XInput.DeviceQueryType.Gamepad"/></strong></td><td>Limit query to devices of Xbox 360 Controller type.</td></tr> </table> <p>?</p> <p>Any value of <em>dwflags</em> other than the above or 0 is illegal and will result in an error break when debugging.</p> </dd></param>
        /// <param name="capabilitiesRef"><dd> <p>Pointer to an <strong><see cref="SharpDX.XInput.Capabilities"/></strong> structure that receives the controller capabilities.</p> </dd></param>
        /// <returns><p>If the function succeeds, the return value is <strong><see cref="SharpDX.Win32.ErrorCode.Success"/></strong>. </p><p>If the controller is not connected, the return value is <strong><see cref="SharpDX.Win32.ErrorCode.DeviceNotConnected"/></strong>. </p><p>If the function fails, the return value is an error code defined in WinError.h. The function does not use <em>SetLastError</em> to set the calling thread's last-error code.</p></returns>
        /// <remarks>
        /// <p><strong>Note</strong>??The legacy XINPUT 9.1.0 version (included in Windows?Vista and later) always returned a fixed set of capabilities regardless of attached device.</p>
        /// </remarks>
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='XInputGetCapabilities']/*"/>
        /// <msdn-id>microsoft.directx_sdk.reference.xinputgetcapabilities</msdn-id>
        /// <unmanaged>unsigned int XInputGetCapabilities([In] unsigned int dwUserIndex,[In] XINPUT_DEVQUERYTYPE dwFlags,[Out] XINPUT_CAPABILITIES* pCapabilities)</unmanaged>
        /// <unmanaged-short>XInputGetCapabilities</unmanaged-short>
        public static int XInputGetCapabilities(int dwUserIndex, SharpDX.XInput.DeviceQueryType dwFlags, out SharpDX.XInput.Capabilities capabilitiesRef)
        {
            unsafe {
                capabilitiesRef = new SharpDX.XInput.Capabilities();
                int __result__;

                fixed(void *capabilitiesRef_ = &capabilitiesRef)
                __result__ =
                    XInputGetCapabilities_(dwUserIndex, unchecked ((int)dwFlags), capabilitiesRef_);

                return(__result__);
            }
        }
Esempio n. 3
0
 static extern Int32 XInputGetCapabilities(Int32 dwUserIndex, Int32 dwFlags, out SharpDX.XInput.Capabilities caps);
Esempio n. 4
0
 /// <summary>
 /// <p>Retrieves the capabilities and features of a connected controller.</p>
 /// </summary>
 /// <param name = "dwUserIndex"><dd> <p>Index of the user's controller. Can be a value in the range 0?3. For information about how this value is determined and how the value maps to indicators on the controller, see Multiple Controllers. </p> </dd></param>
 /// <param name = "dwFlags"><dd> <p>Input flags that identify the controller type. If this value is 0, then the capabilities of all controllers connected to the system are returned. Currently, only one value is supported:</p> <table> <tr><th>Value</th><th>Description</th></tr> <tr><td><strong>XINPUT_FLAG_GAMEPAD</strong></td><td>Limit query to devices of Xbox 360 Controller type.</td></tr> </table> <p>?</p> <p>Any value of <em>dwflags</em> other than the above or 0 is illegal and will result in an error break when debugging.</p> </dd></param>
 /// <param name = "capabilitiesRef"><dd> <p>Pointer to an <strong><see cref = "SharpDX.XInput.Capabilities"/></strong> structure that receives the controller capabilities.</p> </dd></param>
 /// <returns><p>If the function succeeds, the return value is <strong>ERROR_SUCCESS</strong>.</p><p>If the controller is not connected, the return value is <strong>ERROR_DEVICE_NOT_CONNECTED</strong>.</p><p>If the function fails, the return value is an error code defined in WinError.h. The function does not use <em>SetLastError</em> to set the calling thread's last-error code.</p></returns>
 /// <remarks>
 /// <strong>Note</strong>??The legacy XINPUT 9.1.0 version (included in Windows?Vista and later) always returned a fixed set of capabilities regardless of attached device.?
 /// </remarks>
 /// <doc-id>microsoft.directx_sdk.reference.xinputgetcapabilities</doc-id>
 /// <unmanaged>DWORD XInputGetCapabilities([In] DWORD dwUserIndex,[In] DWORD dwFlags,[Out] XINPUT_CAPABILITIES* pCapabilities)</unmanaged>
 /// <unmanaged-short>XInputGetCapabilities</unmanaged-short>
 public static unsafe System.Int32 XInputGetCapabilities(System.Int32 dwUserIndex, SharpDX.XInput.DeviceQueryType dwFlags, out SharpDX.XInput.Capabilities capabilitiesRef)
 {
     SharpDX.XInput.Capabilities.__Native capabilitiesRef_ = default(SharpDX.XInput.Capabilities.__Native);
     capabilitiesRef = default(SharpDX.XInput.Capabilities);
     System.Int32 __result__;
     __result__ = XInputGetCapabilities_(dwUserIndex, unchecked ((System.Int32)dwFlags), &capabilitiesRef_);
     capabilitiesRef.__MarshalFrom(ref capabilitiesRef_);
     return(__result__);
 }