I'm trying to make the Middle Mouse Button fire Alt-Tab events, but in such a way that the activation is automatically made after the middle mouse button has been idle for a while.
This to allow scrolling through the Alt Tab menu by repetively clicking the middle mouse button, and having the selection activated by not clicking again for say 2 secs.
I tried several things, including forcecully restarting the script, but it doesn't give the desired result.
Then I came across the built-in AltTabMenu and AltTabMenuDismiss functions, but getting AltTabMenuDismiss fired after 2 secs doesn't work (function can only be hooked to a hotkey one-liner).
Something I tried at the start (which I thought would work: the script restarts, keeps pressing alt, and fires another tab - but unfortunately the re-firing doesn't work well):
Code: Select all
#SingleInstance force
MButton::
Send {Alt down}{Tab} <-- this could also be split into two sentences, also didn't work
Sleep 2000
Send {Alt up}
return
Code: Select all
#SingleInstance force
MButton::
Send {LAlt down}
Loop
{
Send {TAB}
Sleep 1000
if not GetKeyState("MButton", "P")
break
}
Send {LAlt up}
I must admit I only started with AutoHotKey 2 hrs ago... A great tool though!!!