Apple 脚本模拟按键事件 [英] Apple script simulate key events
问题描述
我想知道 F1-F12 中所有功能键的键码.从以前的搜索查询中,我发现键码 107 可以通过运行此命令来降低亮度
I want to know the key codes for all the function keys from F1-F12. From previous search queries I have found keycode 107 to turn brightness down by running this
<代码>echo "告诉应用程序\"系统事件\"关键代码 107结束告诉" | osascript
我猜这是模拟 F1 键,但奇怪的是 113
会调高亮度.我无法找到任何其他 Fn 键的键码.有什么帮助吗?有没有为此制作的漂亮表格,我可以在其中获取密钥代码.最后,我希望能够直接执行这些键所做的操作或以某种方式模拟这些操作.什么都行.
And I'm guessing that simulates the F1 key but the weird thing is 113
turns the brightness up. I haven't been able to find key codes for any other Fn keys. Any help? Is there a nice table made for this where I can get the keycodes. In the end I want to be able to either directly perform the actions that these keys do or somehow simulate those actions. Anything would be fine.
推荐答案
Key code 107 not F1 code;它是亮度控制的单独代码.音量控制也有一个,但它坏了.密钥代码是半随机顺序的,无法预测.功能键是:
Key code 107 is not the F1 code; it is a separate code for Brightness control. There is also one for Volume control, but it is broken. The key codes are in semi-random order and can not be predicted. The Function keys are:
F1=122, F2=120, F3=99, F4=118, F5=96, F6=97, F7=98, F8=100, F9=101, F10=109, F11=103, F12=111
F1=122, F2=120, F3=99, F4=118, F5=96, F6=97, F7=98, F8=100, F9=101, F10=109, F11=103, F12=111
这篇关于Apple 脚本模拟按键事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!