KDestiny Posted April 28, 2020 Share Posted April 28, 2020 A script to send Alt F4 to any program (It's for the sega Fusion emulator) or a Shift Tab Quote Link to comment Share on other sites More sharing options...
Lordmonkus Posted April 28, 2020 Share Posted April 28, 2020 Quote Link to comment Share on other sites More sharing options...
latin625 Posted September 29, 2021 Share Posted September 29, 2021 (edited) Ok. Got it solved. That last thread from LordMonkus was the charm. Just change the .exe to the one you want to close. Thanks. $ESC::WinClose, ahk_exe higan.exe Edited September 29, 2021 by latin625 Quote Link to comment Share on other sites More sharing options...
Montana75 Posted November 22, 2021 Share Posted November 22, 2021 Or use this code. $Esc:: { WinClose, ahk_exe {{{StartupEXE}}} } 1 Quote Link to comment Share on other sites More sharing options...
meecob Posted February 15, 2022 Share Posted February 15, 2022 This doesn't work for Yuzu. I've tried everything, I literally mean everything. Hitting escape just goes to windowed mode and then I have to press ctrl+q. Alt f4 does work but I'd like to use escape like all my other platforms. Can't I map ctrl + f4 to escape or ctrl + q ? Cheers my friend Quote Link to comment Share on other sites More sharing options...
bundangdon Posted February 15, 2022 Share Posted February 15, 2022 17 minutes ago, meecob said: This doesn't work for Yuzu. I've tried everything, I literally mean everything. Hitting escape just goes to windowed mode and then I have to press ctrl+q. Alt f4 does work but I'd like to use escape like all my other platforms. Can't I map ctrl + f4 to escape or ctrl + q ? Cheers my friend Try this in the "Running Script" section. (Copy and paste) This works for me with Yuzu and several other emulators. Then, you can press ESC to exit out of games. ; This section closes Yuzu when pressing Escape $Esc:: { Process, Close, {{{StartupEXE}}} } Quote Link to comment Share on other sites More sharing options...
meecob Posted February 16, 2022 Share Posted February 16, 2022 23 hours ago, bundangdon said: Try this in the "Running Script" section. (Copy and paste) This works for me with Yuzu and several other emulators. Then, you can press ESC to exit out of games. ; This section closes Yuzu when pressing Escape $Esc:: { Process, Close, {{{StartupEXE}}} } I just typed a really long winded message and it didn't submit my reply. I doesn't work for me. It just takes me back to windowed mode. Control Q does work fine but I wish to use Escape. The bit where I said "I've tried everything, I literally mean everything" I meant it. Thanks for trying. Quote Link to comment Share on other sites More sharing options...
Retro808 Posted February 16, 2022 Share Posted February 16, 2022 3 hours ago, meecob said: I just typed a really long winded message and it didn't submit my reply. I doesn't work for me. It just takes me back to windowed mode. Control Q does work fine but I wish to use Escape. The bit where I said "I've tried everything, I literally mean everything" I meant it. Thanks for trying. Both of these work just make sure you place either in the “Running Script” tab and NOT the “Exit Script” tab $Esc:: { WinClose, ahk_exe {{{StartupEXE}}} } or you can use $Esc:: Send ^q Quote Link to comment Share on other sites More sharing options...
Your Friendly A.I Overlord Posted February 16, 2022 Share Posted February 16, 2022 7 hours ago, meecob said: I doesn't work for me. It just takes me back to windowed mode. Control Q does work fine but I wish to use Escape. Make sure you do not run yuzu.exe with admin rights. Quote Link to comment Share on other sites More sharing options...
musarezeq Posted September 29, 2022 Share Posted September 29, 2022 (edited) Hi, I tried most of these scripts to close most of the games. They were working flawlessly with the most but with some are not. let me more specific, Most of "Outright Games" like, PawPatrol Adventure City Calls. when I press physically Alt+F4 on my keyboard, the game close with no problem but not with the script !! any help is really appreciated. Edited September 29, 2022 by musarezeq Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted September 29, 2022 Share Posted September 29, 2022 5 hours ago, musarezeq said: Hi, I tried most of these scripts to close most of the games. They were working flawlessly with the most but with some are not. let me more specific, Most of "Outright Games" like, PawPatrol Adventure City Calls. when I press physically Alt+F4 on my keyboard, the game close with no problem but not with the script !! any help is really appreciated. If you have the Steam version and are using the Steam ID# to launch the game, it's not going to work this way. If you use the Steam game.exe to launch it, it may work. But either way, you really should be exiting it through the games' menu (for Steam games). If you have a console version, which emulator are you using for your game? Quote Link to comment Share on other sites More sharing options...
musarezeq Posted September 29, 2022 Share Posted September 29, 2022 Thank you for your reply. I am using the windows version. I know it is always better to close windows games through the game menu itself, but because I found that actually easier for my kids to just press one button to switch to another game. But the strange thing the command that I use, actually work on other games but that one is not , although it can still be closed by pressing the Alt+F4 on keyboard!! Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted September 30, 2022 Share Posted September 30, 2022 3 hours ago, musarezeq said: But the strange thing the command that I use, actually work on other games but that one is not , although it can still be closed by pressing the Alt+F4 on keyboard!! Since it's a Windows game and you're not using an emulator, how exactly are you setting up the command? I assume an AutoHotkey script launched via an Additional App. What does your script look like? Are you trying to set it to a key on the keyboard (i.e. ESC)? Or a button on a controller? Both? Quote Link to comment Share on other sites More sharing options...
musarezeq Posted September 30, 2022 Share Posted September 30, 2022 I am trying to set it to ESC key on keyboard. My following script is working fine with "Race with Ryan" game. I used the same script for the Paw Patrol game (with changing the RaceWithRyan.exe to PPMT.exe) name but with no success. $Esc:: { Run, E:\Emulators\Xpadder 2013 work well\Xpadder.exe /C Process, Close, {{{StartupEXE}}} } { WinClose, ahk_exe RaceWithRyan.exe } Send, !{F4} Escape:: ExitApp Return And I used also the more simple one which is: $Esc:: Send, !{F4} but also not work. But as I said when this script fails to close the required game (Paw Patrol), I pressed the Alt+F4 on keyboard and the game close directly. I really appreciate your time spending reading my messages , so please don't bother yourself in that issue. I already teach my kid how to use Alt+F4 to close the game. Don't worry!! 😅 1 Quote Link to comment Share on other sites More sharing options...
Kinglifer Posted January 22, 2023 Share Posted January 22, 2023 On 9/30/2022 at 5:51 AM, musarezeq said: I really appreciate your time spending reading my messages , so please don't bother yourself in that issue. I already teach my kid how to use Alt+F4 to close the game. Don't worry!! 😅 You ever got this to work? Quote Link to comment Share on other sites More sharing options...
musarezeq Posted January 23, 2023 Share Posted January 23, 2023 9 hours ago, Kinglifer said: You ever got this to work? Actually no. I have no idea why it fails. I tried on different PCs but with no success. Any help is really appreciated. Quote Link to comment Share on other sites More sharing options...
latin625 Posted February 2, 2023 Share Posted February 2, 2023 Put this in the RUNNING SCRIPT TAB of the Emulator: $ESC::WinClose, ahk_exe EMULATOR.EXE Quote Link to comment Share on other sites More sharing options...
Truest1 Posted June 10, 2023 Share Posted June 10, 2023 Hey guys a need a ahk script to long press esc key sends alt+F4 . Anyone can help please? Or maybe hold 1 key and esc sends alt+F4? Quote Link to comment Share on other sites More sharing options...
skizzosjt Posted June 10, 2023 Share Posted June 10, 2023 10 hours ago, Truest1 said: Hey guys a need a ahk script to long press esc key sends alt+F4 . Anyone can help please? Or maybe hold 1 key and esc sends alt+F4? try this out. it works for me Esc:: KeyWait, Esc, T3 ;wait to see if esc key is held down for 3 seconds ("T3" = Time/duration of 3 seconds) If (ErrorLevel = 1) { ;if pressed for 3 seconds Send {RAlt down}{F4 down}{F4 up}{RAlt up} ;send Alt+F4 KeyWait, Esc ;waits for hotkey to be released, this prevents a regular keypress (esc) from being sent on release due to not being at exactly 3 secs } Else ;if held less than 3 seconds Esc::Esc ;send esc as if it were a regular keypress Quote Link to comment Share on other sites More sharing options...
Truest1 Posted June 10, 2023 Share Posted June 10, 2023 2 hours ago, skizzosjt said: try this out. it works for me Esc:: KeyWait, Esc, T3 ;wait to see if esc key is held down for 3 seconds ("T3" = Time/duration of 3 seconds) If (ErrorLevel = 1) { ;if pressed for 3 seconds Send {RAlt down}{F4 down}{F4 up}{RAlt up} ;send Alt+F4 KeyWait, Esc ;waits for hotkey to be released, this prevents a regular keypress (esc) from being sent on release due to not being at exactly 3 secs } Else ;if held less than 3 seconds Esc::Esc ;send esc as if it were a regular keypress Thank you I will try this out Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.