0

Apple provides https://developer.apple.com/documentation/appkit/nseventtype/nseventtypesystemdefined?language=objc

This page says nothing more than:

No overview available. Declaration: NSEventTypeSystemDefined = 14

4
  • 1
    Not much help but see NSEvent.h and the deprecated NSSystemDefined, "The remaining event types—NSAppKitDefined, NSSystemDefined, and NSApplicationDefined—are less structured, containing only generic subtype and data fields. Of these three miscellaneous event types, only NSApplicationDefined is of real use to application programs.". What do you want to know? Commented Nov 11, 2019 at 11:32
  • 1
    See also -[NSEvent otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:], "type: One of the following event-type constants: NSAppKitDefined, NSSystemDefined, NSApplicationDefined, NSPeriodic. Your code should only create events of type NSApplicationDefined." Commented Nov 11, 2019 at 11:33
  • Specifically I'm trying to intercept (maybe eat) and inject mouse and keyboard events. I notice Left Mouse Down generates a NSEventTypeSystemDefined with data1:1, data2:1, subtype 7, Up gives data2:0. So if I create my own mouse events, should I recreate these? I'm currently not doing so, and everything seems to be working. Commented Nov 11, 2019 at 15:53
  • Also, I'm trying to catch+eat CAPSLOCK, which must be one of the hardest keys on the keyboard. That generates a subtype:d3, But if I plug in an external keyboard I'm able to get more exotic events. I'm considering an alternative plan where I watch the raw key up/down event at the IOHID layer (nice and clean, only I don't seem to be able to eat it), and then eat the associated events using an event-tap. Commented Nov 11, 2019 at 15:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.