Jblz619 Posted September 1, 2023 Posted September 1, 2023 Hello I was able to easily find out how to utilize Autoit to detect game pad joy sticks and buttons with this code. But why can i not find anything to simply send a gamepad button. Is there any UDF or examples on a simple send gamepad button. I'm going to use it to remap keyboard inputs to gamepad. Not Gamepad to keyboard. I'm surprised there is no UDF or simple send button functions to interact with gamepads. Please if anyone can Help i would be much appreciated. expandcollapse popup;====================================== ; _JoyInit() ;====================================== Func _JoyInit() Local $joy Global $JOYINFOEX_struct = "dword[13]" $joy = DllStructCreate($JOYINFOEX_struct) If @error Then Return 0 DllStructSetData($joy, 1, DllStructGetSize($joy), 1);dwSize = sizeof(struct) DllStructSetData($joy, 1, 255, 2) ;dwFlags = GetAll Return $joy EndFunc ;==>_JoyInit ;====================================== ; _GetJoy($lpJoy,$iJoy) ; $lpJoy Return from _JoyInit() ; $iJoy Joystick # 0-15 ; Return Array containing X-Pos, Y-Pos, Z-Pos, R-Pos, U-Pos, V-Pos,POV ; Buttons down ; ; *POV This is a digital game pad, not analog joystick ; 65535 = Not pressed ; 0 = U ; 4500 = UR ; 9000 = R ; Goes around clockwise increasing 4500 for each position ;====================================== Func _GetJoy($lpJoy, $iJoy) Local $coor, $ret Dim $coor[8] DllCall("Winmm.dll", "int", "joyGetPosEx", _ "int", $iJoy, _ "ptr", DllStructGetPtr($lpJoy)) If Not @error Then $coor[0] = DllStructGetData($lpJoy, 1, 3) $coor[1] = DllStructGetData($lpJoy, 1, 4) $coor[2] = DllStructGetData($lpJoy, 1, 5) $coor[3] = DllStructGetData($lpJoy, 1, 6) $coor[4] = DllStructGetData($lpJoy, 1, 7) $coor[5] = DllStructGetData($lpJoy, 1, 8) $coor[6] = DllStructGetData($lpJoy, 1, 11) $coor[7] = DllStructGetData($lpJoy, 1, 9) EndIf Return $coor EndFunc ;==>_GetJoy
Somerset Posted September 1, 2023 Posted September 1, 2023 (edited) like this https://xpadder.com/?lang=english&country=US did a quick search using google. Edited September 1, 2023 by Somerset
Jblz619 Posted September 1, 2023 Author Posted September 1, 2023 (edited) 14 hours ago, Somerset said: like this https://xpadder.com/?lang=english&country=US did a quick search using google. That seems like it might be a work around but still, it would be great to not have to use a 3rd party software that you have to pay for. Shouldn't Autoit have a udf that does this? Edited September 1, 2023 by Jblz619
Nine Posted September 1, 2023 Posted September 1, 2023 7 minutes ago, Jblz619 said: Shouldn't Autoit have a udf that does this? Yes, and I suggest you write it. https://learn.microsoft.com/en-us/windows/win32/api/joystickapi/nf-joystickapi-joysetcapture Is that what you are looking for ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Somerset Posted September 2, 2023 Posted September 2, 2023 Dude that was a sample of what i found as a search return. Is it really so hard to use a search engine? https://www.oneswitch.org.uk/art.php?id=33
Jblz619 Posted September 2, 2023 Author Posted September 2, 2023 (edited) 18 hours ago, Somerset said: Dude that was a sample of what i found as a search return. Is it really so hard to use a search engine? https://www.oneswitch.org.uk/art.php?id=33 I apologize if I came across rude. I'm just looking for a udf or a point in the right direction. Ty for finding a work around I have REWASD that does this already. On 9/1/2023 at 12:55 PM, Nine said: Yes, and I suggest you write it. https://learn.microsoft.com/en-us/windows/win32/api/joystickapi/nf-joystickapi-joysetcapture Is that what you are looking for ? That is really close I taught myself autoit years ago and only somewhat understand c++. There is Vjoy udf I recall from years ago. Maybe thats where I should start with. BTW What's up with the hostile responses? I've used autoit for years and everyone is usually very helpfully. In at least pointing me in the right direction so I can write my own programs. Ty again if anyone knows of any udfs that allow you to send commands to a gamepad. That would be much appreciated. This is the closest thing i could find Edited September 2, 2023 by Jblz619
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now