Using the Robot class in Java to simulate “Fn” key press

假如想象 提交于 2019-12-12 18:16:58

问题


I'm trying to write a small program that makes the backlight of my laptop's keyboard flash whenever I receive an email/text/other type of message. I'm trying to use Java's Robot class to do this.

My problem so far is that I cannot seem to find the keycode for the "Fn" key.


回答1:


Java generally does not recognize multimedia key strokes (and Fn is generally considered non-standard keyboard key) as valid ones in its inbuilt libraries and will return 0 on non-standard keystroke event.

But you can get your key by using Intellitype library for non-standard keys and also as possible work-around for the input.



来源:https://stackoverflow.com/questions/33286724/using-the-robot-class-in-java-to-simulate-fn-key-press

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!