CGEventSourceStateID
Constants that specify the possible source states of an event source.
Declaration
enum CGEventSourceStateIDOverview
A source state refers to a global event state table. These tables contain accumulated information on modifier flag state, keyboard key state, mouse button state, and related internal parameters placed in effect by posting events with associated sources.
Two pre-existing event state tables are defined:
The
kCGEventSourceStateCombinedSessionStatetable reflects the combined state of all event sources posting to the current user login session. If your program is posting events from within a login session, you should use this source state when you create an event source.The
kCGEventSourceStateHIDSystemStatetable reflects the combined state of all hardware event sources posting from the HID system. If your program is a daemon or a user space device driver interpreting hardware state and generating events, you should use this source state when you create an event source.
Specialized applications such as remote control programs may want to generate and track event source state independent of other processes. These programs should use the kCGEventSourceStatePrivate value in creating their event source. An independent state table and unique source state ID (CGEventSourceStateID) are created to track the event source’s state. This independent state table is owned by the creating event source and released with it.
Topics
Constants
CGEventSourceStateID.privateStateCGEventSourceStateID.combinedSessionStateCGEventSourceStateID.hidSystemState