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
problem trying to remap capslock
Re: problem trying to remap capslock
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
>^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
Who is online
Users browsing this forum: Google [Bot], mmflume and 144 guests