I need to remap certain keys so that CapsLock + “ijkl” would result in arrow keys without actually toggling CapsLock on.
Standard practice.
ChatGPT gave me the following code which worked as expected:
CapsLock::
KeyWait, CapsLock ; Wait until CapsLock is released
return
#If GetKeyState("CapsLock", "T") ; Check if CapsLock is toggled on
i::
Send, {Up}
return
#If
Then I added more key mappings:
CapsLock::
KeyWait, CapsLock ; Wait until CapsLock is released
return
#If GetKeyState("CapsLock", "T") ; Check if CapsLock is toggled on
i::
Send, {Up}
return
j::
Send, {Left}
return
k::
Send, {Down}
return
l::
Send, {Right}
return
#If
And now script runs and only prevents CapsLock from toggling on (seen from LED inactivity on keyboard).
Going back to initial code didn’t change anything (still only blocking CapsLock)
I tried to launch script with double-click, to launch as administrator, to run with UI access
I did reboot the PC just in case 🙂
Since the initial code worked fine the first time I guess the problem isn’t related to syntax but to some system settings.
Roman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.