|Type||Topic||Plugin||Version||macOS||Windows||Linux||Console & Web||iOS|
|class||Carbon Events||MBS MacCF Plugin||4.3||Yes||No||No||Yes, macOS only||No|
The CarbonMonitorEventsMBS class is a special class used to monitor user input events across all processes. When such a class is listening, the Carbon Event Manager examines the event type for user input event types, such as mouse-down, mouse-up, key-down, and so forth. It then requests that the WindowServer make copies of any of these events that are sent to any process, and deliver them to the current process also. These events are queued into the main thread's event queue, and during normal event dispatching are sent directly to the event handlers installed on the event monitor class. Monitored events are not sent through the normal event dispatching path for the current process; they will pass through the event dispatcher target, and will then be sent directly to the event monitor target.
Handlers installed on the event monitor class will only receive events when the current application is inactive. When the current application is active, all event flow occurs through the event dispatcher target, and no events are sent to the event monitor target.
Currently, the event monitor supports the following event kinds: kEventRawKeyDown, kEventRawKeyUp, kEventRawKeyRepeat, kEventRawKeyModifiersChanged, kEventMouseDown, kEventMouseUp, kEventMouseMoved, kEventMouseDragged, kEventMouseWheelMoved, kEventTabletPoint, and kEventTabletProximity.
Note that both Carbon and Cocoa password edit text controls enable a secure input mode while the focus is on the control, which prevents keyboard events from being passed to other applications. This prevents the monitoring event target from being used to sniff password keystrokes.
For added security, GetEventMonitorTarget requires that "Enable access for assistive devices" be checked in the Universal Access preference pane in order to monitor RawKeyDown, RawKeyUp, and RawKeyRepeat events. If this control is not checked, you can still install handlers for these events on the event monitor class, but no events of these types will be sent to your handler. Administrator privileges are required to enable this feature.
Accessibility made need to be turned on. On Mac OS X 10.9 this may not work in debug apps, but only in build apps after second launch.
- 9 events
- event KeyboardRawKeyDown(maccharcode as Integer, keycode as Integer, modifiers as Integer, keyboardtype as Integer) as boolean
- event KeyboardRawKeyModifiersChanged(modifierkeys as Integer) as boolean
- event KeyboardRawKeyRepeat(maccharcode as Integer, keycode as Integer, modifiers as Integer, keyboardtype as Integer) as boolean
- event KeyboardRawKeyUp(maccharcode as Integer, keycode as Integer, modifiers as Integer, keyboardtype as Integer) as boolean
- event MouseDown(x as single, y as single, modifierKeys as Integer, button as Integer, clickcount as Integer, MouseChord as Integer) as boolean
- event MouseDragged(x as single, y as single, modifierKeys as Integer, deltax as single, deltay as single, button as Integer, clickcount as Integer, MouseChord as Integer) as boolean
- event MouseMoved(x as single, y as single, modifierKeys as Integer, deltax as single, deltay as single) as boolean
- event MouseUp(x as single, y as single, modifierKeys as Integer, button as Integer, clickcount as Integer, MouseChord as Integer) as boolean
- event MouseWheelMoved(modifierKeys as Integer, axis as Integer, delta as Integer) as boolean
- 14 properties
- property Available as Boolean
- property EventCount as Integer
- property Lasterror as Integer
- property MouseButton as Integer
- property MouseChord as Integer
- property MouseClickCount as Integer
- property MouseDeltaX as Single
- property MouseDeltaY as Single
- property MouseModifierKeys as Integer
- property MouseX as Single
- property MouseY as Single
- property Tablet as Boolean
- property TabletPoint as CarbonEventsTabletPointMBS
- property TabletProximity as CarbonEventsTabletProximityMBS
- method Listen
This class has no sub classes.
Some examples which use this class:
The items on this page are in the following plugins: MBS MacCF Plugin.
MBS Xojo Chart Plugins