Jump to content
LaunchBox Community Forums

Auto Hotkey Scripts


Lordmonkus

Recommended Posts

I want to have a single thread for this so please share your useful and interesting AHK scripts here.

Provide a short description of what the script does put the script in the post using the code function (the <> at the top of the post box).

Launch Higan in fullscreen mode since not all versions of Higan has a command line parameter to do this:

#NoEnv

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

Universal close emulator with the Escape key, useful for ePSXe:

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

Hide your mouse cursor for certain emulators that don't hide your mouse, change the numbers to match your monitors resolution:

MouseMove, 1920, 1080

Here is a script from @Reynbow that closes out the Higan emulator properly so that it doesn't lose your save game data.

$ESC::WinClose, ahk_exe higan.exe

 

  • Thanks 3
  • Unusual Gem 1
Link to comment
Share on other sites

AHK script for Xarcade tankstick users to exit emulators that do not have internal binding options since Xarcade simulates key strokes. It is modified from the script in this post

Script is set to use Player 4 start button and Player 2 start button as exit. Hold P4 and P2 for more than 2 seconds. Simply change "4" and/or "2" to the key of choice if you desire to use an alternate button key. This is using default Xarcade layout. 

Also you can lengthen or shorten the duration you have to hold the combo by changing "Duration > 2" (this is seconds)

 

~4 & 2::

Duration=0

Loop

{	Duration ++

	If !GetKeyState("4","P") || !GetKeyState("2","P")

		Break

	If Duration > 2

	{	

        WinClose, ahk_exe {{{StartupEXE}}}

		break

	}

	Sleep, 1000

}

return

 

  • Like 1
Link to comment
Share on other sites

In some emulators with some LB versions, this ahk line might crash or exit BB when exiting the game or cause something else undesirable (it is rare though):

Process, Close, {{{StartupEXE}}}

If that happens, one of these other options should solve the problem:



For Demul:

$Esc::
{
     WinClose, ahk_class window ahk_exe demul.exe
} 


For Retroarch:

$Esc::
{
    WinClose, ahk_class RetroArch
} 


For Dolphin:

$Esc::
{
    WinClose, ahk_class wxWindowNR
} 

 

Link to comment
Share on other sites

In case you want to hide the mouse pointer and have nomousy.exe, you can add this ahk code to your emulator's AutoHotkey Script tab (example is for Demul since that one often needs this):

Run, R:\LaunchBox\Games\Tools\nomousy.exe /hide
$Esc::
{
        Run, R:\LaunchBox\Games\Tools\nomousy.exe
        WinClose, ahk_class window ahk_exe demul.exe
}

Just change the path to where you put your nomousy.exe file.

Link to comment
Share on other sites

In case you want to start Xpadder.exe with an emulator's games and then exit Xpadder when exiting the game, you can add this ahk code to your emulator's AutoHotkey Script tab:

Run, C:\Xpadder\Xpadder.exe /m
$Esc::
{
        Run, C:\Xpadder\Xpadder.exe /C
	Process, Close, {{{StartupEXE}}}
}

Just change the path to where you put your Xpadder.exe file.

  • Thanks 4
Link to comment
Share on other sites

On 1-7-2017 at 3:33 AM, Retro808 said:

AHK script for Xarcade tankstick users to exit emulators that do not have internal binding options since Xarcade simulates key strokes. It is modified from the script in this post

Script is set to use Player 4 start button and Player 2 start button as exit. Hold P4 and P2 for more than 2 seconds. Simply change "4" and/or "2" to the key of choice if you desire to use an alternate button key. This is using default Xarcade layout. 

 



~4 & 2::

Duration=0

Loop

{	Duration ++

	If !GetKeyState("4","P") || !GetKeyState("2","P")

		Break

	If Duration > 2

	{	

        Process, Close, {{{StartupEXE}}}

		break

	}

	Sleep, 1000

}

return

 

This looks exectly something that am struggling with for the last 4 days, i have installed AHK could you explain me maybe how i can use this for example with dc emulator nulldc.

How can i add this script within the emulator

Sorry if this is a stupid questions

Link to comment
Share on other sites

I would love to find a way to set my Ultimark U360 analog stick to 4 way on LaunchBox launch and after a game ends.  Anyone have an AHK for that, and some instruction on where to apply it?

Also, best way to automatically apply U360 settings per game?  I used to use hypermap with HyperSpin but am not sure how to configure it properly with LaunchBox.

Thanks.

Link to comment
Share on other sites

  • 1 month later...

This will put CxBx Reloaded into full screen after launching. You can change the app title to whatever you want, to make it work with other emulators.

#NoEnv

WinWaitActive , Cxbx-Reloaded
SetKeyDelay, -1, 110
Send {Alt Down}{Enter}{Alt Up}
Return

 

  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...

Using the process,close script with higan causes issues with the higan not having chance to update the save.ram file. 

At the moment the only solution I've found is to use the 

ESC::

send !{f4}

But this only works if higan is not full screen. When I try and map the full screen toggle button to the AHk script it doesn't work, higan just ignores it. Is there any way to write a script to get around it?

 

Link to comment
Share on other sites

12 hours ago, lordmonkus said:

Sorry I have nothing else then.
I don't use Fusion because of the problems it has and there simply is no reason to use it when we got Retroarch and the Genesis GX core which is superior in every way.

Well, Fusion I don't really care about. Not doing much disc swapping on that emulator. My primary concern is trying to stop ePSXe from closing every time I hit ESC, since that's the key bound to bringing up the menu and selecting what rom it's reading.

But thanks for the help regardless.

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