Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
|
Lista Forumurilor Pe Tematici
|
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login
POZE MRRRR'S FORUM (VIEW ONLY)
Nu sunteti logat.
|
Nou pe simpatie: i.oana
| Femeie 21 ani Bucuresti cauta Barbat 20 - 45 ani |
|
Mrrrr
AdMiN
Inregistrat: acum 17 ani
Postari: 2182
|
|
Source Credits to user alishibaz
These 2 scripts below will help you set the ALT+F4 hotkey combination to ESC key. So when you will press ESC, folders, notepad, browsers etc. will close as if you pressed ALT+F4. Be careful: if you click on desktop and hit ESC, it will ask you wether you want to shut down Windows.
Don't worry, there are 2 scripts so you can activate and deactivate this, for switching between normal ESC and ALT+F4 ESC
1. Open notepad, copy and paste the following text to notepad, then save to C:\AHK as ACTIVATE.ahk
+F1:: ; load script file ACTIVATE.AHK run C:\Program Files (x86)\AutoHotkey\autohotkey.exe C:\AHK\ACTIVATE.ahk exitapp ; "exitapp" eliminates the requirement for any "Return" stmt
+F2:: ; load the new script file DEACTIVATE.AHK run C:\Program Files (x86)\AutoHotkey\autohotkey.exe C:\AHK\DEACTIVATE.ahk exitapp ; "exitapp" eliminates the requirement for any "Return" stmt
ESCAPE::SendInput !{F4} ; close active window |
2. Open notepad, copy and paste the following text to notepad, then save to C:\AHK as DEACTIVATE.ahk
+F1:: ; load script file ACTIVATE.AHK run C:\Program Files (x86)\AutoHotkey\autohotkey.exe C:\AHK\ACTIVATE.ahk exitapp ; "exitapp" eliminates the requirement for any "Return" stmt
+F2:: ; load the new script file DEACTIVATE.AHK run C:\Program Files (x86)\AutoHotkey\autohotkey.exe C:\AHK\DEACTIVATE.ahk exitapp ; "exitapp" eliminates the requirement for any "Return" stmt |
NOTE 1: To ACTIVATE ESC key as ALT+F4, you will use SHIFT+F1 and to DEACTIVATE it you will use SHIFT+F2 NOTE 2: if you are running a 32-bit Windows, replace Program Files (x86) with Program Files.
3. Open registry editor (start - run - regedit - enter) then navigate to key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
4. Create a new string value and name it ACTIVATE. Double click it and under value data insert C:\AHK\ACTIVATE.ahk - this will make it run on Windows start up Note: You can make it start as DEACTIVATED by creating a string called DEACTIVATED and using C:\AHK\DEACTIVATE.ahk as it's value data.
_______________________________________
|
|
pus acum 6 ani |
|
Mrrrr
AdMiN
Inregistrat: acum 17 ani
Postari: 2182
|
|
Another example of such an Autohotkey macro:
;declare all programs to be closed via Escape key ;either the windows' title or class name (prefixed with ahk_class) will do CloseEscape: CloseEsc= ( Join| Foxit Reader WinRAR ahk_class AdobeAcrobat ahk_class WinZipWClass ahk_class WordPadClass )
Loop, Parse, CloseEsc, | { IfWinActive, %A_LoopField% WinClose Else IfWinActive, ahk_class KMeleon Browser Window WinMinimize Else Send,{ESCAPE} }
Return
$Escape:: Gosub, CloseEscape Return |
Source:
_______________________________________
|
|
pus acum 1 an |
|
Mrrrr
AdMiN
Inregistrat: acum 17 ani
Postari: 2182
|
|
AHK_class:
WinClose:
_______________________________________
|
|
pus acum 1 an |
|
Mrrrr
AdMiN
Inregistrat: acum 17 ani
Postari: 2182
|
|
I've found multiple ideas for this, credits go to each of the people who created them (see Sources). Multiple ideas could exist in those topics from Sources, so you should check them out.
Make sure you save each of the codes below to a different .ahk file and see which idea best suits your needs.
Idea 1. Keep ESC key pressed for 500 ms (0,5 seconds) to close active window. Makes sound when 500 ms are reached Note: Needs a file named xxx.wav to exist in the directory where you ahk file is located.
$esc:: settimer, click, -500 WinGetTitle, Title, A KeyDown:=A_TickCount Keywait Esc if (A_TickCount-KeyDown > 500) { If title contains Notepad, Mozilla Firefox, Excel, Notepad++ send, ^w Else winclose, %title% } Else { send {escape} settimer,click, off } Return
click: SoundPlay, %a_scriptdir%\xxx.wav Return |
Idea 2. Double tap ESC to close active window
~Esc:: WinGetClass Class, A If (A_ThisHotKey = A_PriorHotkey && A_TimeSincePriorHotkey < 999) If Class in MozillaUIWindowClass,IEFrame Send ^w Else Send !{F4} Return |
Idea 3. Notepad only: pressing ESC once will save then close Notepad
#IfWinActive, ahk_class Notepad esc:: Send,^s sleep 0500 WinClose Return |
Sources: Idea 1. Idea 2. Idea 3.
_______________________________________
|
|
pus acum 1 an |
|
Mrrrr
AdMiN
Inregistrat: acum 17 ani
Postari: 2182
|
|
Merged 2 topics.
The simplest AHK script for making ESC act like ALT+F4 is:
_______________________________________
|
|
pus acum 1 an |
|