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
}

 

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