Where can I find a list of key codes for use with Cocoa's NSEvent class?

前端 未结 5 1465
无人及你
无人及你 2020-12-24 11:14

I\'m looking for a comprehensive list of the available key codes that can be used with Cocoa\'s NSEvent class. The NSEvent class has a keyCod

5条回答
  •  死守一世寂寞
    2020-12-24 11:26

    To include HIToolbox/Events.h (as mentioned in berrange's answer) in XCode 4 you just need to go to Link Binaries with Libraries and add the Carbon framework (which includes HIToolbox) and then import the main Carbon header in the file where you are checking the keyCodes.

    #import 
    

    It took me a second to figure out that I couldn't import HIToolbox/Events.h directly so I thought I'd post this in case it helps someone.

提交回复
热议问题