Ejemplo n.º 1
0
        /// <summary>
        /// <p>Retrieves a gamepad input event.</p>
        /// </summary>
        /// <param name="dwUserIndex"><dd> <p>[in] Index of the signed-in gamer associated with the device. Can be a value in the range 0?XUSER_MAX_COUNT ? 1, or <see cref="SharpDX.XInput.UserIndex.Any"/> to fetch the next available input event from any user.</p> </dd></param>
        /// <param name="dwReserved"><dd> <p>[in] Reserved</p> </dd></param>
        /// <param name="keystrokeRef"><dd> <p>[out] Pointer to an <strong><see cref="SharpDX.XInput.Keystroke"/></strong> structure that receives an input event.</p> </dd></param>
        /// <returns><p>If the function succeeds, the return value is <see cref="SharpDX.Win32.ErrorCode.Success"/>. </p><p>If no new keys have been pressed, the return value is <see cref="SharpDX.Win32.ErrorCode.Empty"/>. </p><p>If the controller is not connected or the user has not activated it, the return value is <see cref="SharpDX.Win32.ErrorCode.DeviceNotConnected"/>. See the Remarks section below.</p><p>If the function fails, the return value is an error code defined in Winerror.h. The function does not use SetLastError to set the calling thread's last-error code. </p></returns>
        /// <remarks>
        /// <p>Wireless controllers are not considered active upon system startup, and calls to any of the <em>XInput</em> functions before a wireless controller is made active return <see cref="SharpDX.Win32.ErrorCode.DeviceNotConnected"/>. Game titles must examine the return code and be prepared to handle this condition. Wired controllers are automatically activated when they are inserted. Wireless controllers are activated when the user presses the START or Xbox Guide button to power on the controller.</p>
        /// </remarks>
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='XInputGetKeystroke']/*"/>
        /// <msdn-id>microsoft.directx_sdk.reference.xinputgetkeystroke</msdn-id>
        /// <unmanaged>unsigned int XInputGetKeystroke([In] unsigned int dwUserIndex,[In] unsigned int dwReserved,[Out] XINPUT_KEYSTROKE* pKeystroke)</unmanaged>
        /// <unmanaged-short>XInputGetKeystroke</unmanaged-short>
        public static int XInputGetKeystroke(int dwUserIndex, int dwReserved, out SharpDX.XInput.Keystroke keystrokeRef)
        {
            unsafe {
                keystrokeRef = new SharpDX.XInput.Keystroke();
                int __result__;

                fixed(void *keystrokeRef_ = &keystrokeRef)
                __result__ =
                    XInputGetKeystroke_(dwUserIndex, dwReserved, keystrokeRef_);

                return(__result__);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// <p>Retrieves a gamepad input event.</p>
        /// </summary>
        /// <param name = "dwUserIndex"><dd> <p>[in] Index of the signed-in gamer associated with the device. Can be a value in the range 0?XUSER_MAX_COUNT ? 1, or XUSER_INDEX_ANY to fetch the next available input event from any user.</p> </dd></param>
        /// <param name = "dwReserved"><dd> <p>[in] Reserved</p> </dd></param>
        /// <param name = "keystrokeRef"><dd> <p>[out] Pointer to an <strong><see cref = "SharpDX.XInput.Keystroke"/></strong> structure that receives an input event.</p> </dd></param>
        /// <returns><p>If the function succeeds, the return value is <strong>ERROR_SUCCESS</strong>.</p><p>If no new keys have been pressed, the return value is <strong>ERROR_EMPTY</strong>.</p><p>If the controller is not connected or the user has not activated it, the return value is <strong>ERROR_DEVICE_NOT_CONNECTED</strong>. See the Remarks section below.</p><p>If the function fails, the return value is an error code defined in Winerror.h. The function does not use <strong>SetLastError</strong> to set the calling thread's last-error code.</p></returns>
        /// <remarks>
        /// <p>Wireless controllers are not considered active upon system startup, and calls to any of the <em>XInput</em> functions before a wireless controller is made active return <strong>ERROR_DEVICE_NOT_CONNECTED</strong>. Game titles must examine the return code and be prepared to handle this condition. Wired controllers are automatically activated when they are inserted. Wireless controllers are activated when the user presses the START or Xbox Guide button to power on the controller.</p>
        /// </remarks>
        /// <doc-id>microsoft.directx_sdk.reference.xinputgetkeystroke</doc-id>
        /// <unmanaged>DWORD XInputGetKeystroke([In] DWORD dwUserIndex,[In] DWORD dwReserved,[Out] XINPUT_KEYSTROKE* pKeystroke)</unmanaged>
        /// <unmanaged-short>XInputGetKeystroke</unmanaged-short>
        public static unsafe System.Int32 XInputGetKeystroke(System.Int32 dwUserIndex, System.Int32 dwReserved, out SharpDX.XInput.Keystroke keystrokeRef)
        {
            keystrokeRef = default(SharpDX.XInput.Keystroke);
            System.Int32 __result__;

            fixed(void *keystrokeRef_ = &keystrokeRef)
            __result__ = XInputGetKeystroke_(dwUserIndex, dwReserved, keystrokeRef_);

            return(__result__);
        }