天道酬勤,学无止境

cgkeycode

在哪里可以找到Mac虚拟键码列表?(Where can I find a list of Mac virtual key codes?)

问题 我正在使用CGEventCreateKeyboardEvent ,需要知道要使用哪些CGKeyCode值。 具体来说,我紧追Command键的键代码。 该文档提供了其他键的示例: z为6 , shift为56 。 某处必须有Mac虚拟键码列表? 回答1 The more canonical reference is in <HIToolbox/Events.h>: /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h In newer Versions of MacOS the "Events.h" moved to here: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h 回答2 Below is a list of the common key codes for quick reference, taken from

2021-03-29 20:12:02    分类:技术分享    macos   keyboard   quartz-graphics   keycode   cgkeycode

Where can I find a list of Mac virtual key codes?

I'm using CGEventCreateKeyboardEvent and need to know what CGKeyCode values to use. Specifically, I am after the key code for the Command key. The docs give examples for other keys: z is 6, shift is 56. There must be a list of Mac virtual keycodes somewhere?

2021-03-23 05:21:50    分类:问答    macos   keyboard   quartz-graphics   keycode   cgkeycode