Caps Lock Key Question
4 comments
·January 30, 2025Someone
I think an AutoHotKey script could do that (if it runs on Windows 11. I couldn’t easily find that on its site). Approach would be:
- in a “caps lock key pressed” handler, set a timer (https://www.autohotkey.com/docs/v2/lib/SetTimer.htm) that runs every ten seconds
- in that timer, check the value of A_TimeIdleKeyboard (https://www.autohotkey.com/docs/v2/Variables.htm#TimeIdleKey...)
- if it’s too large, call SetCapsLockState (https://www.autohotkey.com/docs/v2/lib/SetNumScrollCapsLockS...) and stop the timer
- otherwise, compute a new ideal delay from the desired run interval and A_TimeIdleKeyboard, and update the time interval
You also wail want to prevent starting multiple timers if you enable caps lock multiple times.
mmh0000
Here's an AHK script I've had since 2007 (omg, I'm too old). Adds a delay (press-and-hold to enable/disable) to capslock. Not exactly what you want, but I loved it and it should be easy to modify to do what you want:
CAPSLKTOOLTIP:
ToolTip,
SetTimer,CAPSLKTOOLTIP,Off
Return
SetTimer,CAPSLKTOOLTIP,1500
SetTimer,CAPSLKTOOLTIP,Off
CapsLock::
counter := 0
Loop,20
{
Sleep, 40
counter++
GetKeyState,state,CapsLock,P
If state=U
Break
If counter >= 20
{
counter := 0
GetKeyState,state,CapsLock,T
If state=D
{
ToolTip,Caps Lock Off
SetCapsLockState,Off
}
Else
{
ToolTip,Caps Lock On
SetCapsLockState,On
}
keyWait, Capslock, U
SetTimer,CAPSLKTOOLTIP,On
Continue
}
}
Return
Tommix11
Thank you, I'll check it out.
null
I would like my caps lock key to switch to lower case after like ten seconds of no keyboard activity. Is this possible on Windows 11?