If (TimerStarted & WasButtonState = XINPUT_GUIDEBUTTON & TimerTime = BUTTON_HOLD_TIME) WasButtonState := ButtonStateīuttonState := State.wButtons TODO: XInputEnable, 'GetBatteryInformation and 'GetKeystroke. Unloads the previously loaded XInput DLL.ĭllCall("FreeLibrary","uint",_XInput_hm), _XInput_hm :=_XInput_GetState :=_XInput_SetState :=_XInput_GetCapabilities :=0 WRightMotorSpeed: NumGet(xiCaps, 18, "UShort") WLeftMotorSpeed: NumGet(xiCaps, 16, "UShort"), If ErrorLevel := DllCall(_XInput_GetCapabilities ,"uint",UserIndex ,"uint",Flags ,"ptr",&xiCaps)īLeftTrigger: NumGet(xiCaps, 6, "UChar"),īRightTrigger: NumGet(xiCaps, 7, "UChar"), XInput.dll returns capabilities via a binary structure: If the controller is not connected, ErrorLevel is 1167 (ERROR_DEVICE_NOT_CONNECTED). If the function succeeds, ErrorLevel is 0 (ERROR_SUCCESS). The controller capabilities, as an associative array. Can be a value in the range 0–3.įlags - Input flags that identify the controller type.ġ - XINPUT_FLAG_GAMEPAD: Xbox 360 Controllers only. UserIndex - Index of the user's controller. Retrieves the capabilities and features of a connected controller. Return DllCall(_XInput_SetState ,"uint",UserIndex ,"uint*",LeftMotorSpeed|RightMotorSpeed<<16) XInput_SetState(UserIndex, LeftMotorSpeed, RightMotorSpeed) The two motors are not the same, and they create The left motor is the low-frequency rumble motor. If the function fails, the return value is an error code defined in Winerror.h. If the controller is not connected, the return value is 1167 (ERROR_DEVICE_NOT_CONNECTED). If the function succeeds, the return value is 0 (ERROR_SUCCESS). RightMotorSpeed - Speed of the right motor, between 5. LeftMotorSpeed - Speed of the left motor, between 5. This function is used to activate the vibration If ErrorLevel := DllCall(_XInput_GetState ,"uint",UserIndex ,"uint",&xiState)ĭwPacketNumber: NumGet(xiState, 0, "UInt")īLeftTrigger: NumGet(xiState, 6, "UChar")īRightTrigger: NumGet(xiState, 7, "UChar") XInput.dll returns controller state as a binary structure: If the function fails, ErrorLevel is an error code defined in Winerror.h. If the controller is not connected, ErrorLevel is ERROR_DEVICE_NOT_CONNECTED (1167). If the function succeeds, ErrorLevel is ERROR_SUCCESS (zero). The current state of the controller as an associative array. Retrieves the current state of the specified controller. Throw Exception("Failed to initialize XInput: function not found.") If !(_XInput_GetState & _XInput_SetState & _XInput_GetCapabilities) _XInput_GetCapabilities := DllCall("GetProcAddress" ,"ptr",_XInput_hm ,"astr","XInputGetCapabilities" ,"ptr") _XInput_SetState := DllCall("GetProcAddress" ,"ptr",_XInput_hm ,"astr","XInputSetState" ,"ptr") || (_XInput_GetState := DllCall("GetProcAddress" ,"ptr",_XInput_hm ,"astr","XInputGetState" ,"ptr")) ![]() Throw Exception("Failed to initialize XInput: " dll " not found.") _XInput_hm := DllCall("LoadLibrary" ,"str",dll ,"ptr") XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE := 8689 XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE := 7849 Device subtypes available in XINPUT_CAPABILITIES Device types available in XINPUT_CAPABILITIES Newer versions of XInput may require additional constants. ![]() NOTE: These are based on my outdated copy of the DirectX SDK. Initializes XInput.ahk with the given XInput DLL.ĭll - The path or name of the XInput DLL to load.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |