Java Robot Keypress Command Key

南楼画角 提交于 2019-11-30 00:35:45

问题


What is the VK_[key] code for the command key on a mac, if one exists? I am trying to get a Robot (java Robot) to press the command key. I am using the command keyPress(), and I need to know the integer keycode for the command key on a mac.


回答1:


KeyEvent.VK_META, with key code 157, is Java's virtual key that maps to the the Mac command key.



来源:https://stackoverflow.com/questions/15418987/java-robot-keypress-command-key

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