AutoHotKey Key Combinations (remap) for key modifiers

autohotkeykeyboard-shortcuts

I want to change the use of Ctrl to Spacebar for three commands in a game but not for everything cause then I can't use space to communicate. The normal commands are Ctrl+q, Ctrl+w, Ctrl+e, Ctrl+r and Control+RButton (right mouse). Right now I'm usng Space::Ctrl, however I have tried different solutions with no result.

[EDIT/]
@MCL Ok. I looked at the forum thread you posted and tried the code below which sorta worked. It sent the keys how I wanted, but each shortcut triggered all shortcuts that followed it. For example space+e triggers space+e, space+r and space.

Also, Spacebar still didn't work. I added the Space::Space later and I can get a text space only by using the Space+(q, w, e or r) shortcuts.

SendMode Input
SetKeyDelay ,0,30

#IfWinActive ahk_class RiotWindowClass

Space & q::
            Send {Ctrl down}
            Sleep 30
            Send {q down}
            Sleep 30
            Send {q up}
            Sleep 30
            Send {Ctrl up}

Space & w::
            Send {Ctrl down}
            Sleep 30
            Send {w down}
            Sleep 30
            Send {w up}
            Sleep 30
            Send {Ctrl up}

Space & e::
            Send {Ctrl down}
            Sleep 30
            Send {e down}
            Sleep 30
            Send {e up}
            Sleep 30
            Send {Ctrl up}

Space & r::
            Send {Ctrl down}
            Sleep 30
            Send {r down}
            Sleep 30
            Send {r up}
            Sleep 30
            Send {Ctrl up}

Space & RButton::
            Send {Ctrl down}
            Sleep 30
            Send {RButton down}
            Sleep 30
            Send {RButton up}
            Sleep 30
            Send {Ctrl up}

Space::Space

#IfWinActive

[/EDIT]

Best Solution

Found it. I needed to add the returns.

#NoEnv
SendMode Input
#InstallKeybdHook
#UseHook

#IfWinActive ahk_class RiotWindowClass

Space & q::
            Send {Ctrl down}
            Sleep 30
            Send {q down}
            Sleep 30
            Send {q up}
            Sleep 30
            Send {Ctrl up}
            return

Space & w::
            Send {Ctrl down}
            Sleep 30
            Send {w down}
            Sleep 30
            Send {w up}
            Sleep 30
            Send {Ctrl up}
            return

Space & e::
            Send {Ctrl down}
            Sleep 30
            Send {e down}
            Sleep 30
            Send {e up}
            Sleep 30
            Send {Ctrl up}
            return

Space & r::
            Send {Ctrl down}
            Sleep 30
            Send {r down}
            Sleep 30
            Send {r up}
            Sleep 30
            Send {Ctrl up}
            return

Space & RButton::
            Send {Ctrl down}
            Sleep 30
            Send {RButton down}
            Sleep 30
            Send {RButton up}
            Sleep 30
            Send {Ctrl up}
            return

Space::
            Send {Space}
            return

#IfWinActive
Related Question