Search code examples
autohotkey

How do you remap alt+tab in autohotkey using w+n?


I'm quite new to working with Windows and I'm struggling with re-assigning keybinds using AutoHotKey.

Especially I struggle with re-assigning the AltTab key:

SetCapsLockState, AlwaysOff
#if GetKeyState("CapsLock", "P")
w & n::AltTab
#if

My goal is, to use CapsLock as a modifier key and then press "n" while holding "w" to tab through my open windows. In fact, the snippet above works. However, it kills my "w" key in the sense, that pressing "w" doesn't do anything anymore.

Does someone have an idea how to solve this issue?

Thanks in advance.


Solution

  • Custom Combinations says

    The prefix key loses its native function. To avoid this, configure it to perform a new action.

    SetCapsLockState, AlwaysOff
    
    #if GetKeyState("CapsLock", "P")
        w & n::AltTab
    #if
    
    w::Send w