Solution to Capslock / Shift every key

autohotkeykeyboardkeyboard shortcuts

I would like every key to be equivalent to "Shift + " when caps lock is turn on. Currently caps lock only capitalizes letters, not other keys.

So if I press:
'/", then it should be " rather than '
1/!, then it should be ! rather than 1

This may be out of scope, but does AHK work for remapping keys in other programs?

In other words, where does AHK sit in the execution from the actual hardware to the OS to the application receiving the keypress event?

Anyway to trace this flow?

Best Answer

#NoEnv
#UseHook

; Add the keys you want to be shifted while Capslock is on in this array this way:
Keys := ["1","2","3",",",".","-"] ; ...
for each, key in Keys
    Hotkey, %key%, Shift_Key, On 
return

Shift_Key:
If GetKeyState("Capslock","T")
    SendInput, +%A_ThisHotkey%
else
    SendInput, %A_ThisHotkey%
return
Related Question