True permanent key swapping

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
p1r
Posts: 3
Joined: 14 Nov 2016, 10:29

True permanent key swapping

22 Jan 2018, 16:03

Hi.
I have been using AHK quite a lot, however I have still not managed to completely swap two keys that I have wanted to for years. So now I am asking instead! :D
What I am looking for is this:

Code: Select all

LAlt::CTRL
and although LAlt works like CTRL, it will not work when specifying further commands building on that swap:

Code: Select all

^k::SendInput {UP}
^j::SendInput {LEFT}
By pressing ALT+k will now work like CTRL+k, but if it is pressed again (while holding down LALT), it will simply just print "k". I need it to keep going UP when holding LALT and pressing k. (and LALT has to be swapped to CTRL)
Is this possible?
Also there will be more commands like so:

Code: Select all

LAlt::RCTRL

^k::SendInput,{UP}
^j::SendInput,{LEFT}

^!k::SendInput,{Ctrl down}{UP}
^!j::SendInput,{Ctrl down}{LEFT}
Thanks in advance
p1r
Posts: 3
Joined: 14 Nov 2016, 10:29

Re: True permanent key swapping

23 Jan 2018, 07:59

If this is not possible, it would be nice to know. I have tried InputLevel and heard about threads having a hard time in windows etc. Maybe these things can be the reason that this is not possible?
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: True permanent key swapping

25 Jan 2018, 18:36

^!k::SendInput,{Ctrl down}{UP}
This will leave Ctrl stuck down. I would suggest using ^!k::SendInput, ^{UP} instead.

Otherwise, your script works just fine for me. I believe v1.1.27.00 fixed the issue you described.

For more permanent and reliable swapping of keys, refer to the "registry remapping" method mentioned in the documentation.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Joey5 and 193 guests