How to tap (hook) F7 through F12 and Power/Eject on a MacBook keyboard
问题 This question follows from How to hook/remap an arbitrary keyboard event on OSX? So far I am able to tap the modifier keys and most of the other keys using: _eventTap = CGEventTapCreate( kCGHIDEventTap, kCGHeadInsertEventTap, kCGEventTapOptionDefault, CGEventMaskBit( kCGEventKeyDown ) | CGEventMaskBit( kCGEventFlagsChanged ) , (CGEventTapCallBack)_tapCallback, (__bridge void *)(self)); Notably, F3 correctly reports a keycode (160) before taking action. i.e. I can disable the action by having