Is it possible to tell if scroll lock mode is currently on through javascript without capturing scroll lock key press event (key was pressed outside of the browser)?
Is it possible to get Scroll Lock status in javascript?
1.7k views Asked by serg At
6
There are 6 answers
0
On
Yes, you can! :D
But not Always :'(
It depends on the OS :(
https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState
The KeyboardEvent.getModifierState() method returns the current state of the specified modifier key: true if the modifier is active (that is the modifier key is pressed or locked), otherwise, false.
Best regards!
No. As you can see in the Event interface properties, there's no scroll lock key state.