how to get Apple “command button” key code programmatically?
问题 i need to know what key code of Command button in mac keyboard, do somebody know how to get it programmatically? can i get the key code if user tap button Command + X (cut shortcut)? thank you for the suggestion 回答1: I'm going to assume here that you're dealing with NSEvents generated by the AppKit framework. In NSEvent's documentation, take a look at the modifierFlags method. And the flag you're lookng for is specifically the NSCommandKeyMask. Now, to get it, if you have a NSView view in