Check Scroll Lock, Num Lock & Caps Lock in JavaScript on Page Load
No, you can't get system state from javascript. You will need them to type something and then analyze the input. Probably not what you wanted to hear =/
IN 2019, this is now possible:
var x = event.getModifierState("ScrollLock");
Source: https://www.w3schools.com/jsref/event_mouse_getmodifierstate.asp