Scripting button presses
#1
I have been trying to use python to execute a sequence of button presses in pcsx2, but I've had no luck.

Something I'd like to achieve would be to execute a script, and then have the X button in pcsx2 be pressed. Using the SendKeys functions in python doesn't seem to work, no matter which keyboard API in lilypad I use. I've successfully gotten MacroMaker to send input commands as suggested in this thread, but I need to be able incorporate other things in the script besides button presses.

Have any of you managed to manipulate pcsx2 input using python (or any scripting language)? I'd appreciate any suggestions.
Reply

Sponsored links

#2
AutoHotkey_L is not bad and it works with pcsx2

You can also try the language you are currently using but send keys(if that language support it)state.

Here is a little example on AutoHotkey_L

Code:
SetKeyDelay, 100
~F::
Send, {q Down}{q Up}{w Down}{w Up}
Return

Pressing F will send the q key(which is assigned to the pcsx2 D-PAD Down)and the w key(which is assigned to the pcsx2 D-PAD Up)

SetKeyDelay sets the delay(in milliseconds)that will occur after each keystroke sent
You need delay and sending down and up state for the keys when you want to send keys to pcsx2\pc games
Setting higher delay will hold each of those keys for the time you set.

Or setting it this way will wait 300 milliseconds before each key(not they state)
Code:
~F::
Sleep, 300
Send, {q Down}{q Up}
Sleep, 300
Send, {w Down}{w Up}
Return
Reply
#3
Pcsx2 doesn't seem to pick up on autohotkey.



I've solved my problem, but for those of you trying to script button presses in pcsx2, but also need capabilities of more advanced scripting languages, MacroMaker allows you to invoke other files, such as python scripts.
Reply
#4
AutoHotKey can do that too.
Basically AHK(the AHK_L version is better)can do everything that you can do manually and more

And of course I tested both examples on pcsx2 before posting them
Reply
#5
I've successfully sent keypresses to lilypad using winapi's PostMessage() (might also need FindWindow() and EnumChildWindows() depending on what you're doing), so any programming language that can interface those should work.

I made an automatic lightning bolt dodger (Final Fantasy X, Thunder Plains), heh.
Reply




Users browsing this thread: 1 Guest(s)