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]
SPACE::Send, {SPACE}
to your code. Find out the problem methodically: 1. Does AHK register your keypress? 2. Does AHK send your shortcut in general? (Try it outside your game first!) 3. Does your window receive AHK simulated keystrokes? – MCL#InstallKeybdHook
and#UseHook
in different combinations (just put them at the top of your script). Also, find out if AHK registers your keypress (best by writing something into a file). – MCL