Search code examples
autohotkeyctrl

Using AutoHotKey scripting language is it possible to swap Alt and Ctrl keys and also retain native AltTab key behaviour?


Currently I must Ctrl & Tab to perform a traditional AltTab.

I've already swapped my Alt and Ctrl keys. However, I still want to be able to AltTab traditionally

This is what I have so far:

LCtrl::Alt  
Alt::LCtrl

LCtrl & Tab::AltTab 

Solution

  • LCtrl & Tab::Send {Alt Down}{Tab}{Alt Up}
    

    Is the simple answer and will switch between the last 2 open windows.

    If you want proper functionality, you'll have to read: http://www.autohotkey.com/docs/commands/GetKeyState.htm and use it in conjuction with

    GetKeyState, OutputVar, LCtrl
    If OutputVar = "D"
      Send {Tab}
    

    etc