4

I'm trying to use AutoHotKey to get Alt+Tab and Shift+Alt+Tab in Windows to have the same behavior as Cmd+Tab and Shift+Cmd+Tab in macOS.

Note: Cmd on a mac keyboard sends the Win key.

What I've gotten to work is:

LWin & Tab:: AltTab

What I haven't been able to do is get LWin+Shift+Tab to send Shift+Alt+Tab. I've tried:

  1. #Shift & Tab:: ShiftAltTab (error: must specify L or R for # in this case)
  2. LWin & Shift & Tab :: ShiftAltTab (Can't use 3 custom combinations)
  3.  

    Lwin & Tab::
           if GetKeyState("Shift")
               {
               Send {ShiftAltTab}
               }
           else
               {
               Send {AltTab}
               }
    

I also tried with return lines after each Send line. Nothing happened when pressing either

  • LCmd+Tab (== LWin+Tab) or
  • LCmd+Shift+Tab (== LWin+Shift+Tab).

Is there a quick and simple way to do this? I want to use AHK since it is modifying the combinations to mimic a lot of other Mac keyboard behaviors.

6
LWin & Tab:: 
    AltTabMenu := true
    If GetKeyState("Shift","P")
        Send {Alt Down}{Shift Down}{Tab}
    else
        Send {Alt Down}{Tab}
return

#If (AltTabMenu)

    ~*LWin Up::
        Send {Shift Up}{Alt Up}
        AltTabMenu := false 
    return

#If

Tested on Windows 10.

  • Does it work on your system? – user3419297 Sep 12 '17 at 20:15
  • Yes, it does work – Elijas Nov 25 '18 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.