problem trying to remap capslock

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Skye
Posts: 44
Joined: 20 Jan 2016, 13:49

problem trying to remap capslock

18 Feb 2018, 16:46

I'm trying to make capslock act as capslock when pressed shortly, and have it lock Ctrl when held down longer. Locking Ctrl works fine, but once I used the key normally and capslock is on, pressing the key won't turn it back off. I've been using this same code for quite a while with only one small change: Instead of sending capslock when pressed shortly as the key normally would, I had that send alt-tab. That worked perfectly well, so this is really confusing me.


>^Capslock::
$Capslock::
keyWait,Capslock,T0.5
if(errorlevel){
lock := lock = "yes" ? "no" : "yes"
IfEqual, lock, yes
{
Send, {rctrl down}
Tooltip, Ctrl
}
Else
{
Send, {rctrl up}
Tooltip
}
}
else
{
Send, {CapsLock}
}
return
Skye
Posts: 44
Joined: 20 Jan 2016, 13:49

Re: problem trying to remap capslock

19 Feb 2018, 13:13

nm, got it to work.

>^Capslock::
$Capslock::
keyWait,Capslock,T0.5
if(errorlevel){
lock := lock = "yes" ? "no" : "yes"
IfEqual, lock, yes
{
Send, {rctrl down}
Tooltip, Ctrl
}
Else
{
Send, {rctrl up}
Tooltip
}
}
else
{
if GetKeyState("CapsLock", "T") = 1
SetCapsLockState, Off
else if GetKeyState("CapsLock", "T") = 0
SetCapsLockState, On
}
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mapcarter and 243 guests