Now that I'm back on my Windows 10 system (which I presumed would have the same issues as Windows 8, but maybe not), I'm curious as to what it is that your script is supposed to do.
!SHIFT::SendInput, {LAlt Down}{Tab} initially worked just fine for me without additional workarounds.
When re-tested (with only this line), the hotkey recursively invoked itself and activated Alt+Tab several times in an instant. It just depends on whether !SHIFT is implemented with the "reg" method or the "k-hook" method (see ListHotkeys). The "reg" method allows this recursion. In the context of your script, #If requires the "k-hook" method to be used. For other cases, one can use
$ to force the "k-hook" method:
Code: Select all
$!Shift::SendInput, {LAlt Down}{Tab}
As for the Enter hotkey which "Fixes the Alt Tab Menu from closing after first use", it made no difference whatsoever. Seems like nonsense to me. The only effect this hotkey should have is to prevent anything from happening
when you press Enter while not holding Alt. The Alt Tab menu still disappears when I release Alt, as expected, so the hotkey is pretty useless.
In the absence of any other reason to install the keyboard hook (such as
$ or
#If), adding any #IfWinActive hotkey to the script may cause the keyboard hook to be installed. This may indirectly affect the behaviour of some hotkeys and functions, since the hook is better able to track key state. But since your current script requires the hook anyway (due to #If), the Enter hotkey does not even have this effect.
When I tried without
If (i = 6.3) (since I'm on 10.0, not 6.3), the timer did exactly what I warned about earlier:
I wrote:Your fix subroutine will not necessarily send Enter to the Alt-Tab window. Normally the window disappears when you release Alt, and your sub waits for Alt to be released before sending Enter.
It
reliably sent Enter to the newly activated window, not the Alt-Tab menu.
Note that because you're already holding Alt when you activate !SHIFT, {LAlt down} is redundant. It also causes the hotkey to misbehave if I use RAlt+RShift, though I'm not really sure how. By contrast,
$!Shift::SendInput, {Blind}{Tab} doesn't send a redundant Alt keystroke and works just fine for me with both Alts and both Shifts.
In fact,
!Shift::Tab also works.