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.