Jump to content
LaunchBox Community Forums

Recommended Posts

Posted

Hey guys, I currently have an ahk script running citra and ds4 windows. My problem is I would like the ds4 windows controller to turn off after exiting a game. the secondary are you sure you want to exit screen is not closing when I want to exit. below is my current ahk. Could you pleae help me with force closing ds4 windows?

 

#SingleInstance Force

Run, "Z:\LaunchBox\Emulators\citra\DS4Windows\DS4Windows.exe"

Run, Z:\LaunchBox\Emulators\citra\citra-qt.exe "Z:\LaunchBox\Games\Nintendo 3DS\The.Legend.of.Zelda.A.Link.Between.Worlds.3ds"

sleep, 2000
WinActivate, ahk_exe citra-qt.exe
sleep, 1000
Send {F3 down}
sleep, 100
Send {F3 up}

$Esc::
{
WinClose, ahk_exe citra-qt.exe
WinClose, ahk_exe DS4Windows.exe
}

; This waits for the confirmation window to appear and presses OK automatically
WinWait, DS4Windows, This will disconnect all your connected controllers. Proceed?
WinActivate
Send, {Enter}

Close:
ExitApp

Posted
4 hours ago, derekDemara said:

the secondary are you sure you want to exit screen is not closing when I want to exit.

The WinWait never gets hit because it's in between your $Esc method and Close.

Option "A" (fix the script)

$Esc::
{
  WinClose, ahk_exe citra-qt.exe
  WinClose, ahk_exe DS4Windows.exe

  ; This waits for the confirmation window to appear and presses OK automatically
  WinWait, DS4Windows, This will disconnect all your connected controllers. Proceed?
  WinActivate
  Send, {Enter}

  ExitApp
}

 

Option "B" (simplify the script)

$Esc::
{
  WinClose, ahk_exe citra-qt.exe
  Run, "Z:\LaunchBox\Emulators\citra\DS4Windows\DS4Windows.exe" -command shutdown
  ExitApp
}

 

Posted (edited)
4 hours ago, JoeViking245 said:

The WinWait never gets hit because it's in between your $Esc method and Close.

Option "A" (fix the script)

$Esc::
{
  WinClose, ahk_exe citra-qt.exe
  WinClose, ahk_exe DS4Windows.exe

  ; This waits for the confirmation window to appear and presses OK automatically
  WinWait, DS4Windows, This will disconnect all your connected controllers. Proceed?
  WinActivate
  Send, {Enter}

  ExitApp
}

 

Option "B" (simplify the script)

$Esc::
{
  WinClose, ahk_exe citra-qt.exe
  Run, "Z:\LaunchBox\Emulators\citra\DS4Windows\DS4Windows.exe" -command shutdown
  ExitApp
}

 

Thank you for the reply. Ive tried both suggestions and the confirm exit box still is popping up. i am using version 1.1.33.2 for AHK. That is the version through Launchbox.I put the edited script at the very bottom after deleting mine. I still dont understand why the command to hit enter is not working.

This is what im talking about.

 

 

#SingleInstance Force

Run, "Z:\LaunchBox\Emulators\citra\DS4Windows\DS4Windows.exe"

Run, Z:\LaunchBox\Emulators\citra\citra-qt.exe "Z:\LaunchBox\Games\Nintendo 3DS\The.Legend.of.Zelda.A.Link.Between.Worlds.3ds"

sleep, 2000
WinActivate, ahk_exe citra-qt.exe
sleep, 1000
Send {F3 down}
sleep, 100
Send {F3 up}

$Esc::
{
  WinClose, ahk_exe citra-qt.exe
  WinClose, ahk_exe DS4Windows.exe

  ; This waits for the confirmation window to appear and presses OK automatically
  WinWait, DS4Windows, This will disconnect all your connected controllers. Proceed?
  WinActivate
  Send, {Enter}

  ExitApp
}

 

Edited by derekDemara
Posted
2 hours ago, derekDemara said:

I still dont understand why the command to hit enter is not working.

I don't use DS4Windows myself, so I'm working off part research and part guessing. ;) 

 

Plan "C"  (look for the exe instead of the window title)
(if you're sure your method found and activated the confirmation window, this won't be any better. Just a different approach)

$Esc::
{
  WinClose, ahk_exe citra-qt.exe
  WinClose, ahk_exe DS4Windows.exe

  ; This waits for the confirmation window to appear and presses OK automatically
  WinWait, ahk_exe DS4Windows.exe
  WinActivate
  Send, {Enter}

  ExitApp
}

 

Plan "D" (the brute force method)

$Esc::
{
  WinClose, ahk_exe citra-qt.exe
  Process, Close, DS4Windows.exe
  ExitApp
}

 

Posted
13 hours ago, JoeViking245 said:

I don't use DS4Windows myself, so I'm working off part research and part guessing. ;) 

 

Plan "C"  (look for the exe instead of the window title)
(if you're sure your method found and activated the confirmation window, this won't be any better. Just a different approach)

$Esc::
{
  WinClose, ahk_exe citra-qt.exe
  WinClose, ahk_exe DS4Windows.exe

  ; This waits for the confirmation window to appear and presses OK automatically
  WinWait, ahk_exe DS4Windows.exe
  WinActivate
  Send, {Enter}

  ExitApp
}

 

Plan "D" (the brute force method)

$Esc::
{
  WinClose, ahk_exe citra-qt.exe
  Process, Close, DS4Windows.exe
  ExitApp
}

 

Good news!! Plan C appears to be working. But it only works when I double click the ahk script. When I use BigBox its still getting stuck at the confirm exit popup. Im guessing a focus issue? What are your thoughts?

Posted
1 hour ago, derekDemara said:

Good news!! Plan C appears to be working. But it only works when I double click the ahk script. When I use BigBox its still getting stuck at the confirm exit popup. Im guessing a focus issue? What are your thoughts?

Good to hear.

What do you mean when you double-click it?  Like in LaunchBox, you have to click Play twice? That wouldn't be because of the script.

How exactly do you have this setup in LB?  The games' app path points to the AHK script? Or ThirdParty/AutoHotkey/AutoHotkey.exe "path/to/file.ahk"? Can you share of screenshot for this? 

With how LB and BB does their startup/shutdown screens, there's also a black screen in there somewhere (to hide console windows and such). So very well could be a focus issue [that may only work if you disable startup screens].  To test this theory, [temporarily] disable startup screen for that game and see if that 'fixes' it.

Better yet, try plan "D" and bypass the click-OK altogether.  A screenshot (mentioned above) could/would be worth a thousand words. ;) 

 

Another thought,
Do you intend to create this script for each of your 3DS games? Or just a handful?  Just this one?

You could put a majority of this into the emulators' Running Script. Then add an Additional App to the games [needing it] to start DS4Windows before the game launches.

Posted (edited)
1 hour ago, JoeViking245 said:

Good to hear.

What do you mean when you double-click it?  Like in LaunchBox, you have to click Play twice? That wouldn't be because of the script.

How exactly do you have this setup in LB?  The games' app path points to the AHK script? Or ThirdParty/AutoHotkey/AutoHotkey.exe "path/to/file.ahk"? Can you share of screenshot for this? 

With how LB and BB does their startup/shutdown screens, there's also a black screen in there somewhere (to hide console windows and such). So very well could be a focus issue [that may only work if you disable startup screens].  To test this theory, [temporarily] disable startup screen for that game and see if that 'fixes' it.

Better yet, try plan "D" and bypass the click-OK altogether.  A screenshot (mentioned above) could/would be worth a thousand words. ;) 

 

Another thought,
Do you intend to create this script for each of your 3DS games? Or just a handful?  Just this one?

You could put a majority of this into the emulators' Running Script. Then add an Additional App to the games [needing it] to start DS4Windows before the game launches.

Thanks for the reply. Yes the games path pointed to the AHK script. I experimented with the start up app in LB but with I started BB my xbox one controller would loose focus because of DS4. The only way around that was to press my windows key to get back to focus on BB/Xbox controller.

So this morning I just set up DS4 to launch on my PC start up. So im actually not using any AHK scripts now. That said, I really do appreciate all of your help. Thank you for taking the time to help!

Edited by derekDemara
  • Game On 1

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