Jump to content
LaunchBox Community Forums

A way to load State in Retroarch using AHK?


exodus_cl

Recommended Posts

Hey guys!  I'm trying to load a state in Retroarch using a hotkey, so I'm using an AHK script, but Retroarch does not load the state even if the script DOES send the hotkey (tested in notepad)

The non working part of code I have looks like this:

sleep, 5000
Send, {f4}

If I send, for example, ALT+F4 Retroarch does close, so I don't know what could be wrong.
For my purpose, this must be done outside Launchbox using an AHK file.

Link to comment
Share on other sites

12 minutes ago, exodus_cl said:

Hey guys!  I'm trying to load a state in Retroarch using a hotkey, so I'm using an AHK script, but Retroarch does not load the state even if the script DOES send the hotkey (tested in notepad)

The non working part of code I have looks like this:

sleep, 5000
Send, {f4}

If I send, for example, ALT+F4 Retroarch does close, so I don't know what could be wrong.
For my purpose, this must be done outside Launchbox using an AHK file.

Why not just set the hotkey in retroarch?

Link to comment
Share on other sites

Posted (edited)
1 hour ago, neil9000 said:

Why not just set the hotkey in retroarch?

Lightgun games, I'm trying to avoid the use of a keyboard, the idea is to load a game, wait for 5 seconds and send F4 to load a state in order to skip all the steps to get to the "Mission Start" screen

Edited by exodus_cl
Link to comment
Share on other sites

1 hour ago, exodus_cl said:

The non working part of code I have looks like this:

Before the 'Send' line, try adding  SetKeyDelay, 125, 50

 

Edit:

Or longhand like LaunchBox does it from the Pause Menu

; RetroArch loads state with F4 key by default
Send {F4 down}
Sleep 50
Send {F4 up}

Link to comment
Share on other sites

14 minutes ago, JoeViking245 said:

Before the 'Send' line, try adding  SetKeyDelay, 125, 50

 

Edit:

Or longhand like LaunchBox does it from the Pause Menu

; RetroArch loads state with F4 key by default
Send {F4 down}
Sleep 50
Send {F4 up}

You are the man!!! thank you!!!!
Te sleep between the press and the release did it!

I tried to send press and release before, but it did not occur to me to put a sleep between them.

 

Thanks again!!

  • Game On 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...