AutoHotKey and Windows 8: Alt+Tab command does not work

6,127

Solution 1

Setting UIAccess=true in the executable's embedded manifest appears to solve this problem. The executable must also be in a trusted location, such as the Program Files folder. For more information and a script which makes the necessary modification for you, find EnableUIAccess on the AutoHotkey forum.

Thanks to Cliff Smolinsky for posting the following on the Synergy issue tracker:

A number of security changes have been implemented in Windows 8 which prevent programs which are not Metro apps from injecting keys that would remove you from the Metro environment. The way this works is that the keyboard shortcut is ignored if it doesn't come from a physical keyboard or a program that has the appropriate permissions. [...] In order to have the proper permissions, the program must be built with UIAccess

I was unable to confirm this via any official source, aside from the following vague comment at MSDN:

An accessibility application can use SendInput to inject keystrokes corresponding to application launch shortcut keys that are handled by the shell. This functionality is not guaranteed to work for other types of applications.

Solution 2

I found I could send an Alt+Tab with the following :

F1::SendInput, !{Tab}

In other words, I had to change "Send" to "SendInput" to get this to work with Windows 8.

Solution 3

If you are using AutoHotkey (Basic), the code base hasn't been updated since September 2009. Obviously, any fundamental changes in Windows 8 have not been addressed. AutoHotkey_L is much more up-to-date, having last been updated this month. However, looking at the changelog, further Windows 8 support is minimal.

If your script still doesn't work even after installing AutoHotkey_L, you could try the other Send commands:

  • SendRaw
  • SendInput
  • SendPlay
  • SendEvent

Otherwise, you just have to be patient and wait for the developers to work on adding support for Windows 8.

Solution 4

The first answer gave me a lead to follow, and what worked for me (with Vista) was :

²::SendEvent, !{Tab}

Thanks!

Share:
6,127

Related videos on Youtube

Steven Lu
Author by

Steven Lu

Play a multitouch HTML5 Tetris clone -- don't worry, keyboard will also work great: http://htmltetris.com A huge fan of tmux, and I use Sublime Text and (more often) the indomitable Vim. I have some special experience with: JavaScript & CSS & HTML5 Application design and architecture OpenGL & WebGL CUDA Animation, simulation, etc. Application security Databases: MySQL, Oracle, SQLite C++, template metaprogramming, applied C++ metaprogramming, Clang & LLVM

Updated on September 18, 2022

Comments

  • Steven Lu
    Steven Lu almost 2 years

    I can't get it to work whether I use

    AltTab

    or

    Send {Alt down}{tab}{Alt up}

    I can verify that other commands work because I can get my hotkeys to display a MessageBox. It seems like W8 has changed enough things to break AHK's Alt+Tab hooks.

    Looking for a workaround. I am trying to map LCtrl+Tab to Alt+Tab (and the Shift versions of them).

  • powerboy
    powerboy about 11 years
    I just tried. Doesn't work for me.