Double and Triple ESC key

Share your favorite FastKeys commands
Post Reply
Ruud
Posts: 2
Joined: Jul 7th, ’20, 17:43

Post by Ruud » Jul 7th, ’20, 17:50

Hi,

I would like to make a new command.
Double tap on ESC key closes the window (send F4) (I know, already in the program, but I ruined it :-o )
Triple tap send a CTRL W

So I can close a window and close a TAB in Chrome

Is this possible?

cheers,
Ruud
User avatar
Tom
Posts: 398
Joined: Nov 24th, ’15, 23:39

Post by Tom » Jul 7th, ’20, 19:42

You can still load the example from the Library - search for "Double".

This one would close the window or tab (if in Chrome) on Esc double press:

Code: Select all

WinGetClass Class, A
If (A_ThisHotKey = A_PriorHotkey && A_TimeSincePriorHotkey < 350)
{
	If (Class="Chrome_WidgetWin_1")
  		Send ^{vk57} ;Ctrl w
 	Else
  		Send !{F4}
}
Ruud
Posts: 2
Joined: Jul 7th, ’20, 17:43

Post by Ruud » Jul 8th, ’20, 10:55

Hi tom,

Thx for the quick reply and the perfect solution!
And also for the tip to search for the original in the library

I only had to remove the accolade from your script.

Many thanks from a almost 60 years young dutch guy who is stil learning

Cheers
Ruud
Post Reply