Making Ctrl+Alt combinations available after switching the keys with Autohotkey

I want to switch Ctrl and Alt on my Windows installation, and I use Autohotkey to do it via the script:

LCtrl::Alt
LAlt::Ctrl

This works most of time, but when I want to use a combined hotkey such as Ctrl+Alt+L, it behaves as if I had only pressed Ctrl+L.

How can I write the Autohotkey script to switch the keys, but still allow Ctrl+Alt?


Solution 1:

LCtrl::
   Send, {AltDown}
   KeyWait, % A_ThisHotkey
   Send, {AltUp}
   Return

LAlt::
   Send, {CtrlDown}
   KeyWait, % A_ThisHotkey
   Send, {CtrlUp}
   Return