且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Java Swing中重新映射NumLock键?

更新时间:2023-12-05 10:14:16

我提出的解决方案并非对所有人都适用,但实际上在我们的用例中是***的:

The solution I came up with won't work for everyone, but it's actually optimal in our use-case:

使用Windows注册表进行键盘重新映射.

Use the Windows registry to do the keyboard remapping.

它是永久性的,不需要编写JNI或设备驱动程序,并且在我们的情况下,我们无需担心会为其他应用程序弄乱键盘.很简单.

It's permanent, requires no JNI or device-driver writing and in our case we have no worries about messing up the keyboard for other applications. Very simple.

如果您需要执行此操作并且可以摆脱这种黑客攻击,那么这是一种经济高效的解决方案.

If you need to do this and can get away with this hack, it's the cost-effective solution.