最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

pageload - Check Scroll Lock, Num Lock & Caps Lock in JavaScript on Page Load - Stack Overflow

programmeradmin6浏览0评论

Is it possible to check the status of Scroll Lock, Num Lock and Caps Lock on page load of a web page? I've found ways to check after a keypress using JavaScript, but that's not what I'm asking.

Is it possible to check the status of Scroll Lock, Num Lock and Caps Lock on page load of a web page? I've found ways to check after a keypress using JavaScript, but that's not what I'm asking.

Share Improve this question asked Jan 30, 2012 at 6:17 JustBeingHelpfulJustBeingHelpful 19k39 gold badges167 silver badges250 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 12

IN 2019, this is now possible:

var x = event.getModifierState("ScrollLock"); 

Source: https://www.w3schools./jsref/event_mouse_getmodifierstate.asp

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 =/

发布评论

评论列表(0)

  1. 暂无评论