Make Key Toggleable Like Caps Lock Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
roselovesgreene
Posts: 7
Joined: 04 Jul 2022, 21:24

Make Key Toggleable Like Caps Lock  Topic is solved

Post by roselovesgreene » 04 Jul 2022, 22:11

I've been looking for literally an hour for something that I thought would be easy lol. Essentially, I want to turn the RShift into a Caps Lock key (but it will work with numbers and punctuation as well). Everything I've tried either doesn't work or starts working, but it doesn't toggle off.

Here's the only thing that works, but isn't what I'm looking for.

Code: Select all

RShift::

Send {RShift down}
sleep 3000
Send {RShift up}

return
Also, I literally just installed AHK today, so I'm like a super newbie lol

Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Make Key Toggleable Like Caps Lock

Post by Rohwedder » 04 Jul 2022, 23:47

Hallo,
try:

Code: Select all

$RShift Up::
IF GetKeyState("RShift")
	Send, {RShift Up}
Else
	Send, {RShift Down}
Return
or with ternary operator:

Code: Select all

$RShift Up::Send,% GetKeyState("RShift")?"{RShift Up}":"{RShift down}"

Post Reply

Return to “Ask for Help (v1)”