5

Is it possible to substitute AltTab with only one key press ? i tried this one but it doesn't work

`::AltTab
albator
  • 859
  • 1
  • 10
  • 18

3 Answers3

7

I use this, you may need to change the Sleep delay.

`::
    Send {Alt Down}{Tab}
    Sleep 100
    Send {Alt Up}
    return

I am running Windows 8.1 64-bit and AutoHotkey v1.1.16.05. And my C:\Program Files\AutoHotkey\AutoHotkeyU64.exe is digitally signed by running the script described here (EnableUIAccess.zip) so that Windows allows it to simulate Alt+Tab. The digital sign is required if you are using Windows Vista and onwards.

Download the zip file and extract it. Then run EnableUIAccess.ahk:

  1. It will ask which AutoHotkey executable to sign. Pick one that you need (AutoHotkeyA32.exe, AutoHotkeyU32.exe, AutoHotkeyU64.exe or AutoHotkey.exe).
  2. Then it will ask to save the new executable. You can choose to overwrite the original file or save as another executable.
  3. Finally it will ask to create a "Run Script with UI Access" context menu item. If you choose 'Yes', then you can right-click a .ahk file and choose "Run Script with UI Access", which will use the digitally signed executable to run the .ahk file. But if you choose to overwrite the original file in step 2, then it is not necessary to create this context menu item.
fxam
  • 3,874
  • 1
  • 22
  • 32
  • Many thanks, you save my month !i finally make it work with runing with ui access, this is pretty anonym but necessary, eventually you could add this info to your answer, "run with ui access". – albator Oct 18 '14 at 12:03
  • 1
    I have been using ` to replace Alt+Tab for ages and am happy to see another soul doing that :D – fxam Oct 18 '14 at 12:35
  • I actually replace AutoHotkeyU64.exe with the digitally signed one so I don't need "Run with UI Access". – fxam Oct 18 '14 at 12:36
1

From the docs:

Each Alt-Tab hotkey must be a combination of two keys, which is typically achieved via the ampersand symbol (&).

http://ahkscript.org/docs/Hotkeys.htm#AltTabDetail

Sid
  • 1,709
  • 1
  • 10
  • 17
1

You might even be able to avoid messing around with UIAccess and administrator privileges. This works for me on Windows 8.1:

`::Run "C:\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Window Switcher.lnk"

And for others who are struggling with getting a two-key combination working on Windows 8 or 10, here's an example using Ctrl-Tab to trigger the window switcher:

^Tab::
  Run "C:\Users\Default\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\Window Switcher.lnk"
  SetTimer EnterOnKeyUp, -1
return

EnterOnKeyUp:
  WinWaitActive ahk_class TaskSwitcherWnd
  KeyWait Ctrl
  Send {Enter}
  SetTimer EnterOnKeyUp, Off
return

* Inspired by: Fully Working Alt Tab Win 8

Chris Nolet
  • 8,714
  • 7
  • 67
  • 92