How can I emulate Alt-Tab function on Win 8 using AHK?
I recently installed Windows 8 x64 and tried to keep using an AHK script that worked well on Windows 7. Now I got a new problem on Windows 8.
"How can I emulate Alt-Tab function on Win 8 using AHK?"
1. Until Windows 7, "Send, {Alt Down}{Tab}" launched the application-switching window. On Windows 8, it doesn't work.
2. "AltTab" command doesn't work either.
Thank you for your comments and suggestions in advance.
Send !{ESC}
Work Around - If you just want to toggle between the last program you can use ALT-ESC
Send !{ESC}
I finally joined this community just to say THANK YOU. That workaround has made my day a lot easier.
Find Window Switcher.lnk in C:\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch .
Copy the The shortcut to somewhere else (I use documents/ahk).
Use this script:
#Tab:: Run, "C:\Users\YourUserNameHere\Documents\ahk\Window Switcher"
If you are trying to use the app switcher in SetPoint then I suggest this:
^!*0:: Run, "C:\Users\YourUserNameHere\Documents\ahk\Window Switcher"
Then in SetPoint Bind the keystroke for app switcher to Ctrl+Alt+Shift+0
Thanks, traedoril, for the tip on using Window Switcher.lnk.
It's the work-around I've been looking for. I tried using the ALT-ESC method, but unfortunately this only works in one direction and wont toggle back and forth between two windows the same as ALT-TAB will. Below is the script I use:
;; *****************************************
GoTo.Last.Window:
;; *****************************************
CoordMode, Mouse, Screen
Sleep, 125 ; 1,000 = 1 second
run C:\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Window Switcher.lnk
Sleep, 100 ; 1,000 = 1 second
sendinput {return}
return
I call this subroutine in my script every time i need to use ALT-TAB.
I know this is an old thread, but the topic is still relevant. I hope this might help someone else.
Nice find of that shortcut but AHK is not able to sendinput like tab, enter, or left/right arrow to that popup.
At least in my windows 8.1
No wait nevermind!
I didn't put enough sleep! THANKS FOR THE WORKAROUND!
Here's how i used it to switch to my youtube, press pause/play, and then switch back to the two latest tabs that i am alt tabbing between.
;SCROLLLOCK = PAUSE/PLAY YOUTUBE NO !ESC
sc0046::KeyWait, ScrollLockWinGet, currentwindow,id, aWinActivate, - YouTube - Google ChromeSendInput, {space}WinActivate,ahk_id %currentwindow%run, C:\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Window Switcher.lnksleep, 100SendInput, {tab}SendInput, {return}
So in my getting to know AHK I didn't know/realize there was an AltTab command so i wrote the following:
Where %SleepVar% is a variable I use outside Setkeydelay to make sure the operation is acted upon/completed before moving on. Would that get around the Win8 blockage?
So in my getting to know AHK I didn't know/realize there was an AltTab command so i wrote the following:
Send, {Alt Down}Sleep, %SleepVar%Send, {Tab}Sleep, %SleepVar%Send, {Alt Up}
Where %SleepVar% is a variable I use outside Setkeydelay to make sure the operation is acted upon/completed before moving on. Would that get around the Win8 blockage?
No, it won't.
Why?
Look up UIaccess in the forums.
So in my getting to know AHK I didn't know/realize there was an AltTab command so i wrote the following:
Send, {Alt Down}Sleep, %SleepVar%Send, {Tab}Sleep, %SleepVar%Send, {Alt Up}
Where %SleepVar% is a variable I use outside Setkeydelay to make sure the operation is acted upon/completed before moving on. Would that get around the Win8 blockage?
No, it won't.
Why?
Look up UIaccess in the forums. http://www.autohotke...ative-programs/
A take on alt-tab for win8 utilizing above information. This example uses a Xbox360 controller key-combo (joy1+6) - change them throughout the code to change.
LCtrl & z:: ; AltTabMenu state := GetKeyState("Capslock", "T") if state = 1 SetCapsLockState, Off ; CapsLock On blocks Task Switching metro window Send, !{Tab} ; prevents displaying inactive Task Switching metro window run, Window Switcher.lnk ; must be in script directory otherwise include path WinWait, Task Switching,, 2 KeyWait, Ctrl Send, {Enter} if state = 1 SetCapsLockState, On ; restores CapsLock State state = return #IfWinActive, Task Switching LCtrl & q::Send, {Right} LCtrl & a::Send, {Left}See also: http://ahkscript.org...p=44371&e=44371 and: http://ahkscript.org....php?f=6&t=5192
bye
Nice find of that shortcut but AHK is not able to sendinput like tab, enter, or left/right arrow to that popup.
At least in my windows 8.1
No wait nevermind!
I didn't put enough sleep! THANKS FOR THE WORKAROUND!
Here's how i used it to switch to my youtube, press pause/play, and then switch back to the two latest tabs that i am alt tabbing between.
Why not use COM or ControlSend to do that instead? You wouldn't even have to activate the window.