Toggle Shift for Single Keypress

I am trying to turn my shift key into a CapsLock of sorts. The goal being that, when Shift is pressed, it shifts the next key to be pressed (eliminating the need to hold down the shift key), similar to the function of StickyKeys but only for the Shift key. I am able to toggle the Shift key using:

LShift:: Send % "{Blind}{LShift " . ((lshift:=!lshift) ? "Down}" : "Up}")

But that requires me to press Shift again, basically turning it into a CapsLock. How can I have this action only last for one keypress?

Upvotes: 1

Views: 1459

Answers (1)

Forivin
Forivin

Reputation: 15538

This should do:

$LShift:: 
    SendInput, {LShift Down}
    KeyWait, LShift
    SendInput, {LShift Down}
    Input, Key, L1 V
    SendInput, {LShift Up}
Return

edit:

$*LShift:: 
    SendInput, {LShift Down}
    Input, Key, L1 M V
    If GetKeyState("LShift", "P")
        KeyWait, LShift
    SendInput, {LShift Up}
Return

Upvotes: 2

Related Questions