What I need is to detect, whether the caps lock key at the very moment is down. So I don’t need the state (on/off), I want to check if the user keeps the caps lock pressed down. Is it possible with javascript? I want to create something like an Enso Launcher inside the browser.
Share
On most browsers, you’ll get
keydownandkeyupevents for CapsLock, try it here (just focus the page and press a key). (This article has lots of useful info about keyboard events.)keydowndoesn’t seem to repeat for CapsLock, the way it does for others, but you can watch forkeydownand assume it’s down until you seekeyup.