Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting button presses
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.

Sponsored links

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

SetKeyDelay, 100
Send, {q Down}{q Up}{w Down}{w Up}

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)
Sleep, 300
Send, {q Down}{q Up}
Sleep, 300
Send, {w Down}{w Up}
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.
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
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.

Users browsing this thread: 1 Guest(s)