Constants that specify the possible source states of an event source.
- macOS 10.4+
- Mac Catalyst 13.0+
- Core Graphics
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:
ktable 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.
CGEvent Source State Combined Session State
ktable 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.
CGEvent Source State HIDSystem State
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
k value in creating their event source. An independent state table and unique source state ID (
CGEvent) are created to track the event source's state. This independent state table is owned by the creating event source and released with it.