Need to disable ALT+F4's closing application functionality

Ask gaming related questions (AHK v1.1 and older)
Lepes
Posts: 141
Joined: 06 May 2021, 07:32
Location: Spain

Re: Need to disable ALT+F4's closing application functionality

Post by Lepes » 02 Oct 2022, 03:59

did you tested !f4::return on Notepad.exe??? If you do and Notepad doesn't close, it means that the problem is not AHK, the problem is your game, maybe it has hardcoded !f4 to close the game and you can do nothing with it.

I mean, I have !f4 doing different staff on some apps and it works.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


!f4:: Send, {f13}
f13:: msgbox, yeah f13 pressed
Test this script outside of your game and in your game.

tiltedtim
Posts: 13
Joined: 15 Sep 2022, 08:25

Re: Need to disable ALT+F4's closing application functionality

Post by tiltedtim » 05 Oct 2022, 08:04

I've tested it in and out of game. It works if I only want to disable !f4, but that's not my full ask. My desired outcome is to disable the force-quit function that !f4 has. I use !f4 as an ability in the game, so !f4 still needs to work but not close the game.

tiltedtim
Posts: 13
Joined: 15 Sep 2022, 08:25

Re: Need to disable ALT+F4's closing application functionality

Post by tiltedtim » 05 Oct 2022, 08:36

I found a work-around, if anyone from the WoW community stumbles upon this. For context, I'm playing resto shaman with a Razer Naga and the mouse buttons 1-12 are assigned to F1-F12 in game. I use the F-keys as my main abilities to free up 1-6 keys for additional easy-access abilities. F4 is a heal and using the modifier ALT casts any spell on yourself, so if I need to heal myself I'll press ALT+F4 which force-quits the game. The workaround isn't ideal but very simple. I've reassigned the 4 key on my mouse to the normal 4 key instead of f4. It's not ideal because you lose an additional ability on your hot bar but it works for now.

Post Reply

Return to “Gaming Help (v1)”