Jump to content
LaunchBox Community Forums

Auto Hotkey Scripts


Lordmonkus

Recommended Posts

14 hours ago, Xngears said:

Hi there, I was wondering if someone could kindly create a script for me to go with the Dolphin emulator.

I want to make it so that every time I launch Dolphin, it also launches DS4Windows. But I also want DS4Windows to close when I close Dolphin.

Try: go to Tools, Manage, Emulators, and edit you Dolphin emulator.  In the Running Script section, add

Run, "D:\Utils\DS4Windows\DS4Windows.exe",,Min

Esc::
{
	Process, Close, DS4Windows.exe
	WinClose, ahk_exe Dolphin.exe
}

Change the path to where your DS4Windows.exe is located

Link to comment
Share on other sites

11 hours ago, JoeViking245 said:
Process, Close, X360CE.exe

Same issue.  I also removed the closing part of the script, and its still freezing up on ESC.  So the opening part seems to be causing the issue on close.  I did try to run X360CE as admin and without admin and it didnt make a difference. 

Link to comment
Share on other sites

4 minutes ago, gerrymarsh87 said:

I did try to run X360CE as admin and without admin and it didnt make a difference. 

Good.  Don't do that. ;) 

So the only line in your Running Script is   Run, "c:\blah blah\x360CE.exe",,Min?    Nothing else?   

[correct] And x360ce loads and you controller does what it's supposed to do while playing a game?

[correct]  And since you no longer have the exit routine in the running script, when you exit the game, the emulator closes as it should but x360ce is "freezing"?

Can you give a little more detail about "freezing"?  Just X360ce?  The whole computer?  If not the whole computer, what happens if your start another game using the Yuzu emu?

Link to comment
Share on other sites

4 hours ago, JoeViking245 said:

Good.  Don't do that. ;) 

So the only line in your Running Script is   Run, "c:\blah blah\x360CE.exe",,Min?    Nothing else?   

[correct] And x360ce loads and you controller does what it's supposed to do while playing a game?

[correct]  And since you no longer have the exit routine in the running script, when you exit the game, the emulator closes as it should but x360ce is "freezing"?

Can you give a little more detail about "freezing"?  Just X360ce?  The whole computer?  If not the whole computer, what happens if your start another game using the Yuzu emu?

Yes this is my running script.  Run, "C:\Users\Gerry\Desktop\X360CE\X360CE.exe",,Min

Yes it does

No issues with the emulator closing.  

Its just X360CE, it says not responding, and I have to end the task.  I have tried another Yuzu game, and tried the script with another emulator and I am having  issues. 

Link to comment
Share on other sites

12 hours ago, gerrymarsh87 said:

Its just X360CE, it says not responding, and I have to end the task.

"Process, Close" should be closing it the same way as if you opened Task Manager and clicked End Task.  Which tells me the Escape sequence isn't getting caught.  Maybe try shelling out some money to Escape sequence by adding $ to it.

Run, "C:\Users\Gerry\Desktop\X360CE\x360ce.exe",,Min

$Esc::
{
	Process, Close, x360ce.exe
	WinClose, ahk_exe yuzu.exe
}

 

If that still doesn't work, as an "experiment" change $Esc:: to !a::  Load a Yuzu game and once it's fully running, press {Alt}+{a}.  If that shuts down X360CE and Yuzu, we're getting somewhere.

Link to comment
Share on other sites

16 hours ago, gerrymarsh87 said:

Its just X360CE, it says not responding, and I have to end the task.  I have tried another Yuzu game, and tried the script with another emulator and I am having  issues. 

A while back I did exactly the same as you, using X360ce for my Thrustmaster wheel. And I did experience the same problem. If I recall correctly the reason was that X360ce does not like to be launched minimized.  For me, when X360ce was launched minimized it technically did what it was supposed to do, but the GUI froze and was hard to close. I could not find any other solution than to not launch X360ce minimized.

*Edit*

My solution was to launch X360ce as normal (windowed), but when it is fully loaded (after 5 seconds), minimize X360ce to the taskbar using: WinMinimize, ahk_exe x360ce.exe. (I do have to add that I have a separate LaunchBox setup just for playing racing games  with my Thrustmaster wheel and first start X360ce then LaunchBox / BigBox from an AutoHotKey script.)

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

Hey all. Here's a really simple script I wanted to share that I've found extremely useful for platforms that might rely on a full keyboard (for my purposes Apple II).

 

Numpad0::
Run, C:\Program Files\Common Files\microsoft shared\ink\TabTip.exe

Return

 

I use this as a running script with the AppleWin emu for Apple II games to pull up the Windows on screen keyboard. I've paired this with an xpadder profile that maps the right stick of my Xbox controller to control the mouse cursor which can then be used to strike keys on the OSK. Been very useful for playing Apple II games from the couch with Big Box. :)

Link to comment
Share on other sites

On 2/9/2022 at 10:20 AM, JoeViking245 said:

Try: go to Tools, Manage, Emulators, and edit you Dolphin emulator.  In the Running Script section, add

Run, "D:\Utils\DS4Windows\DS4Windows.exe",,Min

Esc::
{
	Process, Close, DS4Windows.exe
	WinClose, ahk_exe Dolphin.exe
}

Change the path to where your DS4Windows.exe is located

This ALMOST works perfectly, so I'm already incredibly thankful for this.

It will open up Dolphin and DS4Windows successfully. The only issue is that DS4Windows.exe sticks around even after Dolphin closes.

This is how I've got the code set up to point to my DS4Windows directory:

Run, "F:\Essential Programs\DS4Windows\DS4Windows.exe",,Min

Esc::
{
    Process, Close, DS4Windows.exe
    WinClose, ahk_exe Dolphin.exe
}

I've also got the mute button on the PS5 controller hotkeyed to shut off Dolphin, if that matters.

Link to comment
Share on other sites

13 hours ago, Your_Friendly_AI_Overlord said:

A while back I did exactly the same as you, using X360ce for my Thrustmaster wheel. And I did experience the same problem. If I recall correctly the reason was that X360ce does not like to be launched minimized.  For me, when X360ce was launched minimized it technically did what it was supposed to do, but the GUI froze and was hard to close. I could not find any other solution than to not launch X360ce minimized.

*Edit*

My solution was to launch X360ce as normal (windowed), but when it is fully loaded (after 5 seconds), minimize X360ce to the taskbar using: WinMinimize, ahk_exe x360ce.exe. (I do have to add that I have a separate LaunchBox setup just for playing racing games  with my Thrustmaster wheel and first start X360ce then LaunchBox / BigBox from an AutoHotKey script.)

Ok so we have some progress..  This script, starts up fine, but it doesnt minimize X360CE, I need to still click off of it, onto my game.  Then on exit, X360CE closes with no issues...  I did verify that ",,min " is whats causing X360CE to not respond. 

Thank You guys for your help so far, this has been occupying my last few nights. 

Currently this is the script I have in there...   

Run, "C:\Users\Gerry\Desktop\X360CE\X360CE.exe"
WinMinimize, ahk_exe x360ce.exe
Esc::
{
    WinClose, ahk_exe X360CE.exe
    WinClose, ahk_exe Yuzu.exe
}

Edited by gerrymarsh87
  • Game On 1
Link to comment
Share on other sites

2 hours ago, gerrymarsh87 said:

Ok so we have some progress..  This script, starts up fine, but it doesnt minimize X360CE, I need to still click off of it, onto my game.  Then on exit, X360CE closes with no issues...  I did verify that ",,min " is whats causing X360CE to not respond. 

Thank You guys for your help so far, this has been occupying my last few nights. 

Currently this is the script I have in there...   

Run, "C:\Users\Gerry\Desktop\X360CE\X360CE.exe"
WinMinimize, ahk_exe x360ce.exe
Esc::
{
    WinClose, ahk_exe X360CE.exe
    WinClose, ahk_exe Yuzu.exe
}

Try:

Run, C:\Users\Gerry\Desktop\X360CE\X360CE.exe
WinWait, ahk_exe X360CE.exe
WinMinimize

$Esc::
{
WinClose, ahk_exe X360CE.exe
WinClose, ahk_exe Yuzu.exe
}

 

  • Like 1
Link to comment
Share on other sites

3 hours ago, Xngears said:

It will open up Dolphin and DS4Windows successfully. The only issue is that DS4Windows.exe sticks around even after Dolphin closes.

This is how I've got the code set up to point to my DS4Windows directory:

Run, "F:\Essential Programs\DS4Windows\DS4Windows.exe",,Min

Esc::
{
    Process, Close, DS4Windows.exe
    WinClose, ahk_exe Dolphin.exe
}

First open DS4Windows and go to [Settings]. Tick [Start Minimized] and make sure [Close Minimizes] is unticked.

199565764_Schermopname(49).thumb.jpg.060417f3c5bba67ad31e2c4cee3dc393.jpg

Then, in LaunchBox, try the following script:

Run, F:\Essential Programs\DS4Windows\DS4Windows.exe

$Esc::
{
Run, F:\Essential Programs\DS4Windows\DS4Windows.exe -command shutdown
WinClose, ahk_exe Dolphin.exe
} 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

13 hours ago, Your_Friendly_AI_Overlord said:

Try:

Run, C:\Users\Gerry\Desktop\X360CE\X360CE.exe
WinWait, ahk_exe X360CE.exe
WinMinimize

$Esc::
{
WinClose, ahk_exe X360CE.exe
WinClose, ahk_exe Yuzu.exe
}

 

This worked, other than on esc, it would close X360CE every other time.  I removed the $ and its working great! Thank You AI Overlord and JoeViking for your help with this!

  • Game On 2
Link to comment
Share on other sites

I have set the script up in all my emulators needed, the only one that gives me a problem is Sega Model 2.  The game launches in the background, starts playing music, but its stuck on the test screen.  I had this issue trying the older script too. I have attached a video of it. 

 

Run, C:\Users\Gerry\Desktop\X360CE\X360CE.exe
WinWait, ahk_exe X360CE.exe
WinMinimize

Esc::
{
WinClose, ahk_exe X360CE.exe
WinClose, ahk_exe emulator.exe
}

Link to comment
Share on other sites

On 2/11/2022 at 6:27 PM, gerrymarsh87 said:

The script is the issue on model 2. It launches fine without the script, and if I open x360ce before, it works with no issues. 

It looks like m2emulator loses focus to X360CE because X360CE launches after m2emulator. M2emulator then pauses / freezes. In LaunchBox you can add X360CE (or an AutoHotKey script to start X360CE) to your game as an additional app to run before launching your game. JoeViking245 created a plugin for LaunchBox to add additional apps to multiple games at once.

*Edit*

@gerrymarsh87 Now that I thought about it some more, I remember mapping the controls of my wheel in m2emulator directly, on a per game basis. I didn't need X360CE for m2emulator. So, first map your controls on a per game basis in m2emulator. Then it is probably a good idea to calibrate your controls in the game's service menu also.

Edited by Your_Friendly_AI_Overlord
Link to comment
Share on other sites

19 hours ago, Your_Friendly_AI_Overlord said:

First open DS4Windows and go to [Settings]. Tick [Start Minimized] and make sure [Close Minimizes] is unticked.

199565764_Schermopname(49).thumb.jpg.060417f3c5bba67ad31e2c4cee3dc393.jpg

Then, in LaunchBox, try the following script:

Run, F:\Essential Programs\DS4Windows\DS4Windows.exe

$Esc::
{
Run, F:\Essential Programs\DS4Windows\DS4Windows.exe -command shutdown
WinClose, ahk_exe Dolphin.exe
} 

This works beautifully. Thank you so much, this was one of the biggest problems I've tried to solve since getting my new PC.

The only thing I'm wondering now is if the script could be edited so that instead of hitting ESC, I can hit a specific button instead. I'm using the Dualsense controller and I've got the mic button mapped to close active windows (thus, close the emulator). Any way I could have that button be the Dolphin+DS4 killer?

I could probably also use something like reWASD to map ESC to the button, but I'm looking for whatever is the simplest method.

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