This is a working draft of a decent alternative to alt-tab. If you assign this to a hotkey, you no longer have to hold down the alt key, and it makes it more convenient to use an auto-hide taskbar without using a mouse. I developed this to use with Dragon NaturallySpeaking since their mouse support is, ahem, cumbersome.
This script sets focus to the first item on the taskbar, "unhiding" the taskbar if necessary. You can then use the arrow keys or type the name of the app to set focus to the item, then press enter to activate it.
[EDIT: this is the new version of the code, see 2 posts down for the new post.]
Code:
; show and activate the taskbar
WinShow ahk_class Shell_TrayWnd
WinActivate ahk_class Shell_TrayWnd
Sleep 40 ; NOTE: you might have to tweak this depending on your system
; open start menu and then tab to the first task listed
SendPlay {LWin}
SendPlay {Escape}{Tab 2}
; move mouse away from the auto-hide taskbar if it's on the left or right side
CoordMode, Mouse, Screen
MouseGetPos, mouseX, mouseY
WinGetPos, barX, barY, width, height, ahk_class Shell_TrayWnd
if( barX < 20 and mouseX <= width )
mouseX := width + 20
if( barX > 20 and mouseX >= barX )
mouseX := barX - 20
MouseMove, % mouseX > width ? mouseX : width + 20, mouseY, 2
return
I hope this is a useful starter script for folks, it's certainly been convenient for me while dealing with RSI... ~Ivo