有什么方法可以打开/关闭 Num、Caps 和 Scroll Lock 灯吗?
有什么方法可以打开/关闭 Num、Caps 和 Scroll Lock 灯吗?这只是为了好玩,我的想法是做一些像迪斯科这样的事情。
Is there any way to turn on/off Num, Caps and Scroll Lock lights? It's just for fun and my idea is to do something like disco.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试
将大写锁定设置为打开。
将大写锁定设置为“关闭”。
并
获取当前状态。
使用
KeyEvent.VK_NUM_LOCK
进行数字锁定。我已经在 Windows 上对此进行了测试。我不确定其他操作系统,但我认为它会起作用。
Try
to set Caps lock On.
to set Caps lock Off.
and
to get current status.
use
KeyEvent.VK_NUM_LOCK
for num lock.I have tested this on Windows. I'm not sure about other OSs but I would think it would work.
大概是通过JNI和ac方法。在这里查看一些讨论:
http://www.autohotkey.com/forum/ viewtopic.php?p=50596#50596
http://www.autohotkey.com/forum/viewtopic.php?t=8372
Probably through JNI and a c method. Check some discussions here:
http://www.autohotkey.com/forum/viewtopic.php?p=50596#50596
http://www.autohotkey.com/forum/viewtopic.php?t=8372
我认为您无法以直接的方式独立于其自身的激活来设置大写/滚动锁定的灯光。
您只能通过编写自己的键盘驱动程序来实现这种行为(或者最终浏览网页以查找可能已经开发出来的驱动程序来实现这种行为),但不建议这样做,并且远远超出了 java 的界限。
另外,这个问题与 如何在不实际打开大写锁定的情况下打开键盘的大写锁定灯?,即使在另一个问题中该行为是在 C# 中实现的。
然而,问题、不可能性以及解决方法都是一样的。
I think you cannot set Caps/Scroll lock's lights independently from their own activation, in a direct way.
You could only achieve such behaviour by programming a keyboard driver of your own (or eventually browsing the web for a driver that might already have been developed to achieve such a behavior), but that is not recommended, and goes way beyond the boundaries of java.
Also, this question is a similar duplicate of Way to turn on keyboard's caps-lock light without actually turning on caps-lock? , even though in this other question that behavior is intended in C#.
However, the issue, impossibility, and the way around it, are the same.