Jump to content
LaunchBox Community Forums

Auto Hotkey Scripts


Lordmonkus

Recommended Posts

36 minutes ago, Retro808 said:

Page 8 has the script you need.

Everything launches great, used the ESC::send !{F4} script and it goes from fullscreen to windowed. Something in my LaunchBox emulator settings? I've tried a dozen scipts and nothing works. Does the same thing in RocketLauncher.

1895667195_2020-06-2409_52_14-LaunchBox.thumb.png.79b41df01f0ab412d29cf5f555eefaa5.png1444741597_2020-06-2409_52_30-LaunchBox.thumb.png.70838aa366cbc116a5e575b812964306.png72694550_2020-06-2409_53_13-.thumb.png.3e4561c400b718140eb48478b6fa4644.png

Link to comment
Share on other sites

2 hours ago, bbweiners said:

{

$Esc::

Process,close,rpcs3.exe

return

}

 

2 hours ago, bbweiners said:

If you use that you won't have to worry about hotkeys changing in the future. I do that for exiting all of my emulators.

I recommend not using that code. Process, close will force close an emulator and on certain ones that need to close properly in order to save the game save state during exit you will have an issue with it not saving. There are several posts about it in this thread. That code will work for a lot of emulators, but better to have a more useful code in case you get one it messes with and you are not aware why.  A known emulator is Higan.

It is recommended to using something like below.

$ESC::WinClose, ahk_exe rpcs3.exe

or even this one as you do not need to specify the exe based on the way LB will send the AHK command.

$Esc::
{
    WinClose, ahk_exe {{{StartupEXE}}}
}

 

  • Thanks 1
Link to comment
Share on other sites

Hi Guys, I know nothing about AHK script and I need your help to close every games I use with "Game Loader All RH.exe". Below is my script and obviously it doesn't work. Could you help me with that please? I use 2 Xb360 joystick.

 

~1joy7 & 3joy7::

Duration=0

Loop

{	Duration ++

	If !GetKeyState("1joy7") || !GetKeyState("3joy7")

		Break

	If Duration > 2

	{	

        Send, {Esc}

		break

	}

	Sleep, 1000

}

return

 

Link to comment
Share on other sites

On 6/29/2020 at 12:54 AM, Fablog said:

Hi Guys, I know nothing about AHK script and I need your help to close every games I use with "Game Loader All RH.exe". Below is my script and obviously it doesn't work. Could you help me with that please? I use 2 Xb360 joystick.

 


~1joy7 & 3joy7::

Duration=0

Loop

{	Duration ++

	If !GetKeyState("1joy7") || !GetKeyState("3joy7")

		Break

	If Duration > 2

	{	

        Send, {Esc}

		break

	}

	Sleep, 1000

}

return

 

If you change 

If !GetKeyState("1joy7") || !GetKeyState("3joy7")

to

 

If !GetKeyState("1joy7", "P") || !GetKeyState("3joy7", "P")

that should work for you holding button 7 on both pads at same time for more than 2 seconds.

Edited by Kiinkyfoxx
Link to comment
Share on other sites

Hi all, 

I am trying to utilize the Keyboard2Xinput software for a cabinet build centered around an Xtension Controller, specifically to play steam games that I am accessing through my front end.

The software provides a sample AHK script for steam games, but this is not my strong suit. I understand how to find steam app IDs, etc., but if someone could use this sample and provide me with an example of how I would implement this for any one game. My issue, is I don’t understand where to insert new or game/program specific information into this script. I'm fairly confident I would be able to use it as a template get my games up and running properly with this software if I understood where the .exe files, etc. were supposed to go. 

Any help would be greatly appreciated. Thanks!

 

EDIT: For anyone that may come across this, I was able to successfully use the method discussed here instead: 

 

Edited by riotide
Link to comment
Share on other sites

On 1/30/2020 at 9:27 PM, mentazm said:

Guys, MUGEN exits with f3, how do I add that into the script below that exits when i hold start+select on my controller?

Joy8::
If GetKeyState("Joy9")
{
   SetKeyDelay, -1, 110
   WinClose, ahk_exe {{{StartupEXE}}}
}
Return

Cheers!

Looking for something similar to close Spectaculator with SELECT(Hotkey) + START. Did you solve the script? Is there an AHS to close every emulator with the same combination?

Thank you in advance!

I'm trying this:

 

Joy12::
If GetKeyState("Joy11")
Process,Close,Spectaculator.exe
Return


After using an AHS application to see what buttons are the SELECT and START buttons. It's my first AHS so I think it's normal it doesn't work...

Edited by JuRaSSiCBoY
Link to comment
Share on other sites

Process Close is not the best method to to close an app.  It's kind of like pressing and holding the power button on your PC to shut down Windows.  Try this:

Joy12::
If GetKeyState("Joy11")
WinClose, ahk_exe Spectaculator.exe 

With this button combo, you need to press [and hold] Joy11 first, then Joy12.  Pressing Joy12 and then pressing Joy11 won't work.

  • Like 1
Link to comment
Share on other sites

Thank you @JoeViking245 !!! @Kiinkyfoxx helped me a lot on a direct message so thank you both!!! It's working now! I'm trying to send the "shift+F1" with the SELECT (Joy11) button too in order to open Spectaculator's Virtual Keyboard. Is it possible to add two scripts into one? Like:

 

Joy12::
If GetKeyState("Joy11")
WinClose, ahk_exe {{{StartupEXE}}}

Joy11::
Send {Shift}{F1}
Return

Tried with:

 

Joy11::
Send +{F1}
Return


 And some variations unsuccessfully.

Thank you again for your help and your time!

Link to comment
Share on other sites

Joy12::
   If GetKeyState("Joy11")
   WinClose, ahk_exe {{{StartupEXE}}}

Joy11::
   KeyWait, Joy11, T1	; 1 = seconds to wait for something else to happen
   if (ErrorLevel)
   Send {Shift}{F1}

Press F11 and then F12 to close.   Press and hold F11 to send {Shift}{F1}.  If you find you can't get to F12 fast enough, change "1" to a "2" or more.  You can also something like "0.5" for 1/2 second.

If you hold F11 long enough, and then press F12, it'll first send {Shift}{F1} and then close the app.

  • Thanks 1
Link to comment
Share on other sites

50 minutes ago, JoeViking245 said:

Joy12::
   If GetKeyState("Joy11")
   WinClose, ahk_exe {{{StartupEXE}}}

Joy11::
   KeyWait, Joy11, T1	; 1 = seconds to wait for something else to happen
   if (ErrorLevel)
   Send {Shift}{F1}

Press F11 and then F12 to close.   Press and hold F11 to send {Shift}{F1}.  If you find you can't get to F12 fast enough, change "1" to a "2" or more.  You can also something like "0.5" for 1/2 second.

If you hold F11 long enough, and then press F12, it'll first send {Shift}{F1} and then close the app.

Thank you a lot!!! It's more functional than my initial script. I've noticed my script and yours are working fine from Launchbox/Big Box, but if I launch Big Box from my Steam Library (just as I normally do), then the script doesn't work. But that is another story, however. I would swear it worked yesterday.

EDIT: Ok! It's working now! I've put the BigBox control mapping numeration for the controller (7 and 8 ) wich are different from those recognized by Windows (11 and 12).

Edited by JuRaSSiCBoY
Link to comment
Share on other sites

2 minutes ago, JoeViking245 said:

You're welcome!  I only use Steam to launch games from BigBox, not the other way around ('cause it seems backwards to me).

I use it this way because I use the Steam Link app in any TV at home and now we can play BigBox in any TV too!!  
To solve the problem I've put the BigBox control mapping numeration for the controller (7 and 8 ) wich are different from those recognized by Windows (11 and 12). I think Steam maps the buttons in their own way to make controls more "generic". Maybe It's good in order to map different gamepads as "XBOX gamepad" or something like this. I'll try it another time.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi all,

I can't get the fullscreen and exit script to work together.

I used the one from Lordmokus and it only worked on the closing part.

Sleep, 3000
SetKeyDelay, -1, 110
Send {F11}
Return

Sleep, 3000
SetKeyDelay, -1, 110
MouseMove, 0, 2160, 0, R

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

Retro808's work, but not the 2 together.

SetTitleMatchMode, 2 (work alone)
  WinWaitActive, Yuzu
  Send {f11}

 
Exit (Work alone)

Esc ::

Send ^ q

How to configure both and working at the same time?

I am using the Early Access 794 version

Thanks,

 

Claudio

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