0
votes

I am not able to switch left shift key to right shift key in AutoHotkey. I tried this code to switch but it worked perfectly for up, down, left and right arrows but didn't work for shift keys. Here's the code..

up::w
down::s
left::a
right::d
freerun::LShift
Numpad8::up

Numpad8::up
Numpad5::down
Numpad4::left
Numpad6::right
RShift::freerun
NumpadAdd::Enter
NumpadEnter::Backspace
4
why is this tagged with CSS?zzzzBov
What does freerun:: bind to? This isn't a valid hotkey.Nelson

4 Answers

1
votes

You must use $ sign, otherwise lshift will fire rshift, which fires lahift. This will go on forever. $ prevents key from firing by send. $LShift::RShift $RShift::LShift

1
votes

There are two important modifiers in AutoHotKey: ~ and $

Without these modifiers hotkey is intercepted and processed. It doesn't propagate. however k::m replaces k with m. k::k causes infinite loop.

~k::m allows k to go through and them prints m. Result is km ~k::k is a fork bomb. It sends kk for each k

$k::m is ignored if k came from AHK and fires if k came from keyboard.

h::k
$k::m

would then produce h -> k and k -> m replacements.

You need to use $LShift::RShift to avoid the loop.

0
votes

Try this

LShift::RShift
RShift::LShift
0
votes

You should use $ to prevent an infinite firing loop. Use this:

$LShift::RShift
$RShift::LShift