#include <IOKit/hidsystem/IOLLEvent.h>
IOKit/hidsystem/IOLLEvent.h Kernel.framework
Interlock with dpsclient/event.h
158 macros · 9 typedefs · 5 structs · 1 union
#define NX_NULLEVENT 0
internal use
#define NX_LMOUSEDOWN 1
left mouse-down event
#define NX_LMOUSEUP 2
left mouse-up event
#define NX_RMOUSEDOWN 3
right mouse-down event
#define NX_RMOUSEUP 4
right mouse-up event
#define NX_MOUSEMOVED 5
mouse-moved event
#define NX_LMOUSEDRAGGED 6
left mouse-dragged event
#define NX_RMOUSEDRAGGED 7
right mouse-dragged event
#define NX_MOUSEENTERED 8
mouse-entered event
#define NX_MOUSEEXITED 9
mouse-exited event
other mouse events
event.data.mouse.buttonNumber should contain the
button number (2-31) changing state.
#define NX_OMOUSEDOWN 25
other mouse-down event
#define NX_OMOUSEUP 26
other mouse-up event
#define NX_OMOUSEDRAGGED 27
other mouse-dragged event
#define NX_KEYDOWN 10
key-down event
#define NX_KEYUP 11
key-up event
#define NX_FLAGSCHANGED 12
flags-changed event
#define NX_KITDEFINED 13
application-kit-defined event
#define NX_SYSDEFINED 14
system-defined event
#define NX_APPDEFINED 15
application-defined event
Zoom events
#define NX_ZOOM 28
#define NX_TABLETPOINTER 23
for non-mousing transducers
#define NX_TABLETPROXIMITY 24
for non-mousing transducers
#define NX_LMOUSEUPMASK (1 << NX_LMOUSEUP)
left mouse-up
#define NX_RMOUSEUPMASK (1 << NX_RMOUSEUP)
right mouse-up
#define NX_OMOUSEUPMASK (1 << NX_OMOUSEUP)
other mouse-up
#define NX_KEYUPMASK (1 << NX_KEYUP)
key-up
#define NX_ZOOMMASK (1 << NX_ZOOM)
Zoom
#define EventCodeMask(type) (1 << (type))
#define NX_ALLEVENTS -1
Check for all events
#define NX_SUBTYPE_DEFAULT 0
#define NX_SUBTYPE_TABLET_POINT 1
#define NX_SUBTYPE_TABLET_PROXIMITY 2
#define NX_SUBTYPE_MOUSE_TOUCH 3
#define NX_SUBTYPE_POWER_KEY 1
#define NX_SUBTYPE_EJECT_KEY 10
#define NX_SUBTYPE_SLEEP_EVENT 11
#define NX_SUBTYPE_RESTART_EVENT 12
#define NX_SUBTYPE_SHUTDOWN_EVENT 13
#define NX_SUBTYPE_ACCESSIBILITY 17
#define NX_SUBTYPE_STICKYKEYS_ON 100
#define NX_SUBTYPE_STICKYKEYS_OFF 101
#define NX_SUBTYPE_STICKYKEYS_SHIFT 102
#define NX_SUBTYPE_STICKYKEYS_CONTROL 103
#define NX_SUBTYPE_STICKYKEYS_ALTERNATE 104
#define NX_SUBTYPE_STICKYKEYS_COMMAND 105
#define NX_SUBTYPE_STICKYKEYS_RELEASE 106
#define NX_SUBTYPE_STICKYKEYS_TOGGLEMOUSEDRIVING 107
New stickykeys key events
These were created to send an event describing the
different state of the modifiers
#define NX_SUBTYPE_STICKYKEYS_SHIFT_DOWN 110
#define NX_SUBTYPE_STICKYKEYS_CONTROL_DOWN 111
#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_DOWN 112
#define NX_SUBTYPE_STICKYKEYS_COMMAND_DOWN 113
#define NX_SUBTYPE_STICKYKEYS_FN_DOWN 114
#define NX_SUBTYPE_STICKYKEYS_SHIFT_LOCK 120
#define NX_SUBTYPE_STICKYKEYS_CONTROL_LOCK 121
#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_LOCK 122
#define NX_SUBTYPE_STICKYKEYS_COMMAND_LOCK 123
#define NX_SUBTYPE_STICKYKEYS_FN_LOCK 124
#define NX_SUBTYPE_STICKYKEYS_SHIFT_UP 130
#define NX_SUBTYPE_STICKYKEYS_CONTROL_UP 131
#define NX_SUBTYPE_STICKYKEYS_ALTERNATE_UP 132
#define NX_SUBTYPE_STICKYKEYS_COMMAND_UP 133
#define NX_SUBTYPE_STICKYKEYS_FN_UP 134
SlowKeys
#define NX_SUBTYPE_SLOWKEYS_START 200
#define NX_SUBTYPE_SLOWKEYS_ABORT 201
#define NX_SUBTYPE_SLOWKEYS_END 202
HID Parameter Property Modified
#define NX_SUBTYPE_HIDPARAMETER_MODIFIED 210
#define NX_ALPHASHIFTMASK 0x00010000
#define NX_SHIFTMASK 0x00020000
#define NX_CONTROLMASK 0x00040000
#define NX_ALTERNATEMASK 0x00080000
#define NX_COMMANDMASK 0x00100000
#define NX_NUMERICPADMASK 0x00200000
#define NX_HELPMASK 0x00400000
#define NX_SECONDARYFNMASK 0x00800000
#define NX_ALPHASHIFT_STATELESS_MASK 0x01000000
#define NX_DEVICELCTLKEYMASK 0x00000001
#define NX_DEVICELSHIFTKEYMASK 0x00000002
#define NX_DEVICERSHIFTKEYMASK 0x00000004
#define NX_DEVICELCMDKEYMASK 0x00000008
#define NX_DEVICERCMDKEYMASK 0x00000010
#define NX_DEVICELALTKEYMASK 0x00000020
#define NX_DEVICERALTKEYMASK 0x00000040
#define NX_DEVICE_ALPHASHIFT_STATELESS_MASK 0x00000080
#define NX_DEVICERCTLKEYMASK 0x00002000
#define NX_STYLUSPROXIMITYMASK 0x00000080
deprecated
#define NX_NONCOALSESCEDMASK 0x00000100
tablet capability masks
Mask bits for the tablet capabilities field. Use these
masks with the capabilities field of a proximity event to
determine what fields in a Tablet Event are valid for this
device.
#define NX_TABLET_CAPABILITY_DEVICEIDMASK 0x0001
#define NX_TABLET_CAPABILITY_ABSXMASK 0x0002
#define NX_TABLET_CAPABILITY_ABSYMASK 0x0004
#define NX_TABLET_CAPABILITY_VENDOR1MASK 0x0008
#define NX_TABLET_CAPABILITY_VENDOR2MASK 0x0010
#define NX_TABLET_CAPABILITY_VENDOR3MASK 0x0020
#define NX_TABLET_CAPABILITY_TILTXMASK 0x0080
#define NX_TABLET_CAPABILITY_TILTYMASK 0x0100
#define NX_TABLET_CAPABILITY_ABSZMASK 0x0200
#define NX_TABLET_CAPABILITY_PRESSUREMASK 0x0400
#define NX_TABLET_CAPABILITY_TANGENTIALPRESSUREMASK 0x0800
#define NX_TABLET_CAPABILITY_ORIENTINFOMASK 0x1000
#define NX_TABLET_CAPABILITY_ROTATIONMASK 0x2000
#define NX_TABLET_POINTER_UNKNOWN 0
#define NX_TABLET_POINTER_PEN 1
#define NX_TABLET_POINTER_CURSOR 2
#define NX_TABLET_POINTER_ERASER 3
size 32, align 4
| SInt32 | x | absolute x coordinate in tablet space at full tablet resolution |
| SInt32 | y | absolute y coordinate in tablet space at full tablet resolution |
| SInt32 | z | absolute z coordinate in tablet space at full tablet resolution |
| UInt16 | buttons | one bit per button - bit 0 is first button - 1 = closed |
| UInt16 | pressure | scaled pressure value; MAX=(2^16)-1, MIN=0 |
| unnamed struct at Kernel/IOKit/hidsystem/IOLLEvent.h:351:5 | tilt | |
| |
| UInt16 | rotation | Fixed-point representation of device rotation in a 10.6 format |
| SInt16 | tangentialPressure | tangential pressure on the device; same range as tilt |
| UInt16 | deviceID | system-assigned unique device ID |
| SInt16 | vendor1 | vendor-defined signed 16-bit integer |
| SInt16 | vendor2 | vendor-defined signed 16-bit integer |
| SInt16 | vendor3 | vendor-defined signed 16-bit integer |
size 32, align 4
| UInt16 | vendorID | vendor-defined ID - typically the USB vendor ID |
| UInt16 | tabletID | vendor-defined tablet ID - typically the USB product ID |
| UInt16 | pointerID | vendor-defined ID of the specific pointing device |
| UInt16 | deviceID | system-assigned unique device ID |
| UInt16 | systemTabletID | system-assigned unique tablet ID |
| UInt16 | vendorPointerType | vendor-defined pointer type |
| UInt32 | pointerSerialNumber | vendor-defined serial number |
| UInt64 | uniqueID | vendor-defined unique ID |
| UInt32 | capabilityMask | capabilities mask of the device |
| UInt8 | pointerType | type of pointing device |
| UInt8 | enterProximity | non-zero = entering; zero = leaving |
| SInt16 | reserved1 | |
size 48, align 4
| unnamed struct at Kernel/IOKit/hidsystem/IOLLEvent.h:385:5 | mouse | |
| | UInt8 | subx | sub-pixel position for x | | UInt8 | suby | sub-pixel position for y | | SInt16 | eventNum | unique identifier for this button | | SInt32 | click | click state of this event | | UInt8 | pressure | pressure value: 0=none, 255=full | | UInt8 | buttonNumber | button generating other button event (0-31) | | UInt8 | subType | | | UInt8 | reserved2 | | | SInt32 | reserved3 | | | unnamed union at Kernel/IOKit/hidsystem/IOLLEvent.h:395:9 | tablet | | | |
|
| unnamed struct at Kernel/IOKit/hidsystem/IOLLEvent.h:400:5 | mouseMove | |
| |
| unnamed struct at Kernel/IOKit/hidsystem/IOLLEvent.h:413:5 | key | |
| |
| unnamed struct at Kernel/IOKit/hidsystem/IOLLEvent.h:427:5 | tracking | |
| |
| unnamed struct at Kernel/IOKit/hidsystem/IOLLEvent.h:439:5 | scrollWheel | |
| |
| unnamed struct at Kernel/IOKit/hidsystem/IOLLEvent.h:439:5 | zoom | |
| |
| unnamed struct at Kernel/IOKit/hidsystem/IOLLEvent.h:452:5 | compound | |
| | SInt16 | reserved | | | SInt16 | subType | event subtype for compound events | | unnamed union at Kernel/IOKit/hidsystem/IOLLEvent.h:455:9 | misc | | | | float[11] | F | for use in compound events | | SInt32[11] | L | for use in compound events | | SInt16[22] | S | for use in compound events | | char[44] | C | for use in compound events |
|
|
| unnamed struct at Kernel/IOKit/hidsystem/IOLLEvent.h:462:5 | tablet | |
| | SInt32 | x | absolute x coordinate in tablet space at full tablet resolution | | SInt32 | y | absolute y coordinate in tablet space at full tablet resolution | | SInt32 | z | absolute z coordinate in tablet space at full tablet resolution | | UInt16 | buttons | one bit per button - bit 0 is first button - 1 = closed | | UInt16 | pressure | scaled pressure value; MAX=(2^16)-1, MIN=0 | | unnamed struct at Kernel/IOKit/hidsystem/IOLLEvent.h:468:9 | tilt | | | | | UInt16 | rotation | Fixed-point representation of device rotation in a 10.6 format | | SInt16 | tangentialPressure | tangential pressure on the device; same range as tilt | | UInt16 | deviceID | system-assigned unique device ID | | SInt16 | vendor1 | vendor-defined signed 16-bit integer | | SInt16 | vendor2 | vendor-defined signed 16-bit integer | | SInt16 | vendor3 | vendor-defined signed 16-bit integer | | SInt32[4] | reserved | |
|
| unnamed struct at Kernel/IOKit/hidsystem/IOLLEvent.h:480:5 | proximity | |
| | UInt16 | vendorID | vendor-defined ID - typically the USB vendor ID | | UInt16 | tabletID | vendor-defined tablet ID - typically the USB product ID | | UInt16 | pointerID | vendor-defined ID of the specific pointing device | | UInt16 | deviceID | system-assigned unique device ID | | UInt16 | systemTabletID | system-assigned unique tablet ID | | UInt16 | vendorPointerType | vendor-defined pointer type | | UInt32 | pointerSerialNumber | vendor-defined serial number | | UInt64 | uniqueID | vendor-defined unique ID | | UInt32 | capabilityMask | capabilities mask of the device | | UInt8 | pointerType | type of pointing device | | UInt8 | enterProximity | non-zero = entering; zero = leaving | | SInt16 | reserved1 | | | SInt32[4] | reserved2 | |
|
typedef union NXEventData NXEventData;
#define kNXEventDataVersion 2
Finally! The event record!
size 88, align 4
| SInt32 | type | An event type from above |
| unnamed struct at Kernel/IOKit/hidsystem/IOLLEvent.h:505:5 | location | |
| |
| UInt64 | time | time since launch |
| SInt32 | flags | key state flags |
| UInt32 | window | window number of assigned window |
| UInt64 | service_id | service id |
| SInt32 | ext_pid | external pid |
| NXEventData | data | type-dependent data |
#define kNXEventVersion 2
How to pick window(s) for event (for PostEvent)
#define NX_NOWINDOW -1
#define NX_BYPSCONTEXT 11
#define NX_EVENT_EXTENSION_LOCATION_INVALID 0x1
#define NX_EVENT_EXTENSION_LOCATION_TYPE_FLOAT 0x2
#define NX_EVENT_EXTENSION_LOCATION_DEVICE_SCALED 0x4
#define NX_EVENT_EXTENSION_MOUSE_DELTA_TYPE_FLOAT 0x8
#define NX_EVENT_EXTENSION_AUDIT_TOKEN 0x10
typedef struct _NXEventExtension NXEventExtension;
typedef struct _NXEventExt NXEventExt;