If Alt held longer than 1.5 seconds... Switcheroo app with AHK

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
techmon
Posts: 54
Joined: 16 May 2017, 13:30

If Alt held longer than 1.5 seconds... Switcheroo app with AHK

Post by techmon » 30 Nov 2023, 15:36

Good day,

I am using this app (Switcheroo) https://github.com/kvakulo/Switcheroo to enhance Alt Tab window switching.
It allows one to search open windows using keyboard via search filter.

I noticed a user posted here of some tweaks that he added via an ahk script: https://github.com/kvakulo/Switcheroo/issues/166 and I wanted the features myself too, so I added the AHK script mentioned on that page:

Code: Select all

{
    #IfWinExist ahk_exe switcheroo.exe
    
	~LButton::
	SendInput, {LButton Down}
	return
	
	!MButton::
	Send ^w
	return
	
	!Alt Up::
	SendInput {Enter Up}
	return
	
	!WheelDown::
	SendInput {down}
	return
	
	!WheelUp::
	SendInput {up}
	return
    
    #IfWinExist
}


This works good! However, I am then unable to type in the textbox at the top of the Switcheroo GUI to filter/find a specific window.

So I thought it would be neat to revise the ahk script to be as follows:

If Alt is held longer than 1.5 seconds, that it would not do: SendInput {Enter Up}

..but rather, that releasing Alt would do nothing and let the Switcheroo GUI active and allow me to type in the textbox at the top of the Switcheroo GUI.

Thanks in advance for your help!
Shawn

Return to “Ask for Help (v1)”