Shafayat Posted July 11, 2010 Posted July 11, 2010 As the title suggests, with this UDF library, you can receive all sorts of input from an standard GamePad.I had one logitech USB gamepad and it Works great with it.I've added lots of samples. They are almost everything you'll ever need when working with a gamepad.FeaturesX,Y,Z,R,U,V AxisGPExGetAxisEx command makes it easy to get direction and speed.get POV (Point of View)Get Buttons (API-ish. you don't even need to remember button values)ToDoVibrationSciTE highlightingHistory7/11/2010 > First releaseComments/Suggestions are very much welcome.RegardsShafayatGamePadEx.zip [Not using this account any more. Using "iShafayet" instead]
Ascend4nt Posted July 11, 2010 Posted July 11, 2010 Very cool. Nice job. Works fine with my Cordless Rumblepad 2 My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
AdmiralAlkex Posted July 11, 2010 Posted July 11, 2010 That must be like the fourth UDF for getting input from gaming-devices, but still, god job! .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Shafayat Posted July 11, 2010 Author Posted July 11, 2010 Thanks for commenting guys. I know that there are other udfs that lets you get GamePad inputs. But when you'll try all of them out, you'll find this one much more standard and easy to use. Besides, you don't have to manually learn how to process the data, Let the udf do the messy stuffs. Taking a look at the samples will suffice. [Not using this account any more. Using "iShafayet" instead]
FuryCell Posted July 11, 2010 Posted July 11, 2010 (edited) Very cool. Maybe I can integrate this into joytunes (control itunes with gamepad/joystick) as some point (providing you don't mind)Edit:Removed quote Edited July 11, 2010 by FuryCell HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
Shafayat Posted July 11, 2010 Author Posted July 11, 2010 Furycell, ofcourse I don't mind. Why else would I publish it as opensource if I didn't want it to be used? [Not using this account any more. Using "iShafayet" instead]
BinaryBrother Posted July 11, 2010 Posted July 11, 2010 (edited) Ok, so I got bored? This sample was modified to cause mouse movements based on the Left Analog stick. (On mine anyway). Haha, fun stuff. expandcollapse popup#include "GamePadEx.au3" #include <Constants.au3> #Include <WinAPI.au3> HotKeySet("{ESC}", "_Quit") ; Just for the demo Global $myGamePadHandle = GPExInitialize() ; Get a handle. This doesn't have to be global but needs to be passed to all the other functions. Global $myID = 0 ; We want to monitor the default GamePad While 1 Sleep(10) $testrawdata = GPExGetRawData($myGamePadHandle, $myID) ; Get almost every data possible from the gamepad. Returns in an array with 8 elements. ; ; Display the RAW output. ; ---> ; ---> Resize the console area so that you can have all the outputs and then move the gamepad. <--- ; ---> ConsoleWrite(@CRLF & "==========================================================") ConsoleWrite(@CRLF & "[0]" & $testrawdata[0]) ; X Axis ConsoleWrite(@CRLF & "[1]" & $testrawdata[1]) ; Y Axis ConsoleWrite(@CRLF & "[2]" & $testrawdata[2]) ; Z Axis ConsoleWrite(@CRLF & "[3]" & $testrawdata[3]) ; R Axis ConsoleWrite(@CRLF & "[4]" & $testrawdata[4]) ; U Axis ConsoleWrite(@CRLF & "[5]" & $testrawdata[5]) ; V Axis ConsoleWrite(@CRLF & "[6]" & $testrawdata[6]) ; Point of View ConsoleWrite(@CRLF & "[7]" & $testrawdata[7]) ; Buttons ConsoleWrite(@CRLF & "==========================================================") If $testrawdata[0] > 32767 Then _WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, ($testrawdata[0] - 32767)/4000) EndIf If $testrawdata[1] > 32767 Then _WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, 0, ($testrawdata[1] - 32767)/4000) EndIf If $testrawdata[0] < 32767 Then _WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, -(32767 - $testrawdata[0])/4000) EndIf If $testrawdata[1] < 32767 Then _WinAPI_Mouse_Event($MOUSEEVENTF_MOVE, 0, -(32767 - $testrawdata[1])/4000) EndIf WEnd Func _Quit() GPExTerminate($myGamePadHandle) ; Just for good manners. Exit EndFunc ;==>_Quit Edited July 11, 2010 by BinaryBrother SIGNATURE_0X800007D NOT FOUND
AdmiralAlkex Posted July 11, 2010 Posted July 11, 2010 Here's links to the other UDF's I know about, if anyone is curious:_Joystick.au3 (take the code form post #4)Joystick.au3SDL.au3Note that the one by elgabionline doesn't work in it's current state, but the others is fine. I prefer my own UDF of course, since among other things, it's the most advanced one (it can get the device's name )#Include "SDL.au3" _SDL_Init($_SDL_INIT_JOYSTICK) For $X = 0 To _SDL_NumJoysticks() -1 ConsoleWrite("Joystick " & $X & ": " & _SDL_JoystickName($X) & @CRLF) Next .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Shafayat Posted July 12, 2010 Author Posted July 12, 2010 I prefer my own UDF of course, since among other things, it's the most advanced one (it can get the device's name )- You like embedding the SDL dll file and increasing the size? Then, maybe I'll try and use DirectX to get Game Input Device's name. lol . All the computers have directX installed. So, you won't even have to embed anything if directX is used. But implementing it might be a bit tricky though. Gonna look into it in a few days. [Not using this account any more. Using "iShafayet" instead]
AdmiralAlkex Posted July 12, 2010 Posted July 12, 2010 I don't think an extra 243 KB is the end of the world, after all AutoItSC.bin is 631 KB, so if you want low size you shouldn't be using AutoIt at all. And SDL reads the name from the registry, so that's easy as pie to get. Or so I imagine, maybe I will give it a try later tonight... .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
MeMeMe Posted August 16, 2010 Posted August 16, 2010 I've downloaded this, and tried to run GamePadEx and nothing happens. How do I use this?
AdmiralAlkex Posted August 16, 2010 Posted August 16, 2010 You need to have a device connected to use it. Do you have any more painfully obvious questions? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
MeMeMe Posted August 17, 2010 Posted August 17, 2010 Wow, that's helpful. You're not in tech support, by any chance? I do have a wired xbox360 controller attached to my computer at all times.
AdmiralAlkex Posted August 17, 2010 Posted August 17, 2010 (edited) Is it really so hard to give us any information about your problem so we can help you instead of give wild guesses? Do you really run around IRL and shouts "How do I use, How do I use, How do I use??" all the time? I hope not.Now write down a nice post where you tell us exactly what is happening, and what your question really is, and we can go from there.Also test the other 2 udf's I listed above.Edit:Wow, that's helpful. You're not in tech support, by any chance?Oh yeah, like you were more helpful when you gave us nothing to work on. At least I gave a valid answer that was the most likely cause of the scripts not working. Edited August 17, 2010 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
MeMeMe Posted August 18, 2010 Posted August 18, 2010 (edited) That post is a little more constructive, but the tone could be less offputting. If we got off on the wrong foot because you inferred some criticism in my question, "How do I use it," please don't - there wasn't any. It was a neutral question. My problem is this: I downloaded the package, GamePadEx, extracted it into its own folder. I double clicked the GamePadEx.au3 file, with an xbox controller attached to my pc (as always), and nothing happened. I opened up each of the *.au3 files, to see if there was any instructions on configuration needed, and didn't see anything I understood. I'm a newbie to AutoIt, so it may be that getting this working is not plug-and-play and requires a level of technical expertise I don't have yet. I don't mind if that is the case. So I asked how to use it, to find out if that was the case. Is there more information you need? Edited August 18, 2010 by MeMeMe
nikitanova Posted August 22, 2010 Posted August 22, 2010 MeMeMe, You should have been running other au3 files in the archive. (i.e. right click and select "run script") GamePadEx.au3 = Core file of UDF. It doesn't do anything but let's the other scripts do things easily. (That's what UDF libs are for)
arcade_extreme Posted April 12, 2020 Posted April 12, 2020 Hi! I have to create a script that closes an app when two buttons are pressed ... what is the syntax function that controls pressing button 10 for example?
Moderators Melba23 Posted April 13, 2020 Moderators Posted April 13, 2020 arcade_extreme, As the OP has not been here for the past 11 years, you may be waiting a long time for a response. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
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