Jump to content
LaunchBox Community Forums

Auto Hotkey Scripts


Lordmonkus

Recommended Posts

When running CXBX-Reloaded from LB/BB, I am able to load games (default.xbe), but I need an AHK script that will do the following, after the game is loaded:

Pass keypress F5 to the emulator (starts emulation)

Pass keypress ALT-RETURN to the emulator (goes full screen)

There are no command line arguments that will do the same.  

 

Also, when quitting CXBX-Reloaded, I need an AHK script which will do the following:

Pass keypress F6 to the emulator (stops emulation)

Pass keypress ALT-F4 to the emulator (closes/exits the emulator)

Many thanks in advance!

Link to comment
Share on other sites

  • 1 month later...

I don't know if there is a way to search a thread? I am looking for a autohotkey script for ppsspp. currently when I try to use the select+start command it dosent work, however I can pause and enter ppsspp menu. this is what I have tried:

$Esc::
{
    Process, Close, {{{StartupEXE}}}
}

Link to comment
Share on other sites

  • 1 month later...

Does anyone use AutoHotKey to automate starting of LaunchBox / Big Box as part of the Windows boot up? I have it working well, however, in cases where LaunchBox is already startred, I like it to press CTRL+B and allowing LaunchBox to gracefully shutdown and launch Big Box.

Unfortunately, I can't seem to send the right keystrokes to Big Box.

This command seems to do nothing:

ControlSend,,^b,ahk_Class HwndWrapper\[LaunchBox\.exe;;[\-\w]*\]

I also tried:

ControlSend,,^b,LaunchBox

Any other suggestions?

In can get AHK to type into NotePad or the Command Prompt screens with no issues, it's just that LaunchBox doesn't accept input?

Edited by coolspot
Link to comment
Share on other sites

  • 3 weeks later...

Hey guys, I am trying to put together a script that allows me to launch bigbox using control+alt+B AND use the same key combo to bring BigBox back into focus. I am able to get BB to launch just fine, but i cannot for the life of me get it to reactivate the window. 

This is what i am using. I found  a 3 year old thread here that somewhat answers my question, but what I am doing it isn't working

here is what ive come up with

#SingleInstance, Force
 ^!B::    ;Ctrl-Alt-B is the shortcut to start BigBox.
       
       run "F:\LaunchBox\BigBox.exe"
       
    IfWinNotExist, - Launchbox Big Box { Run F:\LaunchBox\BigBox.exe }
            
    IfWinExist, - Launchbox Big Box { WinActivate, - Launchbox Big Box }
        Return

Thanks in advance

Edited by CtinD
added to code box
Link to comment
Share on other sites

12 hours ago, JoeViking245 said:

Try this.  I didn't fully test it, but seems like it should work.


$^!B::
if WinExist("ahk_exe BigBox.exe")
   {
      WinActivate
      return
   }
Run "F:\LaunchBox\BigBox.exe"
return

 

Thank you. I'm on my way home right now, will be testing in about an hour and reporting back

 

This works perfectly!!!! Oh thank you SOOOOOO much. You ROCK ?

Edited by CtinD
  • Like 1
Link to comment
Share on other sites

On 7/14/2019 at 7:39 PM, smpetty said:

When running CXBX-Reloaded from LB/BB, I am able to load games (default.xbe), but I need an AHK script that will do the following, after the game is loaded:

Pass keypress F5 to the emulator (starts emulation)

Pass keypress ALT-RETURN to the emulator (goes full screen)

There are no command line arguments that will do the same.  

 

Also, when quitting CXBX-Reloaded, I need an AHK script which will do the following:

Pass keypress F6 to the emulator (stops emulation)

Pass keypress ALT-F4 to the emulator (closes/exits the emulator)

Many thanks in advance!

Check this out. It's working for me in rocket launch. You sound be able to it work outside of RL

 

http://www.rlauncher.com/forum/showthread.php?4881-CxBx-Reloaded

Link to comment
Share on other sites

  • 3 weeks later...

Hoping you guys can help me.  I am going to make a separate launchbox for my kids and what i want is a script that starts when launchbox opens and closes when launchbox closes.

 

i want the script to disable my admin keys on the arcade cab and the mouse.  

The problem is when they are button mashing of course they are jamming all the admin keys and it screws everything up.

any help would be greatly appreciated.

Link to comment
Share on other sites

3 hours ago, pattonthompson said:

Hoping you guys can help me.  I am going to make a separate launchbox for my kids and what i want is a script that starts when launchbox opens and closes when launchbox closes.

 

i want the script to disable my admin keys on the arcade cab and the mouse.  

The problem is when they are button mashing of course they are jamming all the admin keys and it screws everything up.

any help would be greatly appreciated.

honestly, I think the most practical way of doing this is using additional keys that are hidden instead of using button combos.you can put them at the top of your cabinet, under the control panel you could also use a keyboard. Your setup could be different....this is also just my 2 cents.

Link to comment
Share on other sites

On 10/14/2019 at 5:32 PM, Parse said:

Retroarch doesn't support combination of buttons. So is there a script for this?

What I wanted is for Arcade games, like in FBNeo: x3 punches on R2; x3 kicks on L2

Almost got this. Instead of combinations of joystick buttons (it's not possible on AHK), I use the Triggers to a combination of 3 keyboard keys. I'm using a X360 controller.

However, it's spamming the keys when pressed, and sometimes it looks like the keys are not simultaneously pressed. Can someone help me adapt this script or point me in the right direction?

What I hope to do is when I press LT (JoyZ = 100), =z+x+q (on the keyboard) / RT (JoyZ =0), = a+s+w, holding the keys down when I hold the trigger, and releasing when I release the trigger.

Thanks in advance!

 

#Persistent
SetTimer, WatchAxis, 5
return

WatchAxis:
GetKeyState, JoyZ, JoyZ  

KeyToHoldDownPrev = %KeyToHoldDown%

if JoyZ > 55

Send {z down}{x down}{q down}{z up}{x up}{q up}

else if JoyZ < 45

Send {a down}{s down}{w down}{a up}{s up}{w up}

return

 

Link to comment
Share on other sites

@Parse AHK sometimes has issues sending simultaneous key presses within games.  Especially with odd  <letter><letter><letter>  combos.  Try setting the SendMode to Play (instead of Input) and see if that does anything for you.

#Persistent
SendMode Play
SetTimer, WatchAxis, 5
return

WatchAxis:
GetKeyState, JoyZ, JoyZ  

KeyToHoldDownPrev = %KeyToHoldDown%

if JoyZ > 55
  Send {z}{x}{q}

else if JoyZ < 45
  Send {a}{s}{w}

return

On the 2 actual "Send" commands, they may need to be "SendPlay".  But I think setting the SendMode is supposed to take care of that.

 

Link to comment
Share on other sites

I don't have a set up to test this.  So I just used the code and Notepad (and a 360 controller) to see the output.  And ya, SetMode Play didn't work here either.  I was hoping it would when you tested it in an actual game.   Though Send {z}{x}{q} did work with the same results as {z down}{x down}{q down}{z up}{x up}{q up}. At least for me.

You definitely do need #Persistent.  Otherwise it just closes itself (the script) right away.

The SetTimer is also needed. But may want to increase it to somewhere 100 and 200.  In fact, that's probably why it's saturating (spamming?) you key inputs'.  When set to 5, you barely press the trigger and you instantly get "zxqzxqzxqzxqzxqzxqzxqzxqzxq".

Link to comment
Share on other sites

  • 4 weeks later...

Does anybody have any issues with AHK in Big Box mode using SpiceTools?  The button combo (START+COIN) works on launchbox to exit SpiceTools.  However, when i'm in Big Box and I run the same game (using SpiceTools), the button combo does nothing.  Even the Escape key doesn't respond.  I have to use CTRL+SHIFT+ESC to taskkill SpiceTools.  I'm running this in my arcade setup.  Any help is appreciated.

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...