Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

CGEventTapMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class CoreGraphics Events MBS MacCF Plugin 17.4 Yes No No Yes, macOS only No
Function: The class for a Event taps.
Notes:
Taps may be placed at the point where HIDSystem events enter the server, at the point where HIDSystem and remote control events enter a session, at the point where events have been annotated to flow to a specific application, or at the point where events are delivered to the application. Taps may be inserted at a specified point at the head of pre-existing filters, or appended after any pre-existing filters.

Taps may be passive event listeners, or active filters. An active filter may pass an event through unmodified, modify an event, or discard an event. When a tap is registered, it identifies the set of events to be observed with a mask, and indicates if it is a passive or active event filter. Multiple event type bitmasks may be ORed together.
Taps may only be placed at kCGHIDEventTap by a process running as the root user. An exception is raised for other users.

Taps placed at kCGHIDEventTap, kCGSessionEventTap, kCGAnnotatedSessionEventTap, or on a specific process may only receive key up and down events if access for assistive devices is enabled (Preferences Accessibility panel, Keyboard view) or the caller is enabled for assistive device access, as by AXMakeProcessTrusted. If the tap is not permitted to monitor these events when the tap is created, then the appropriate bits in the mask are cleared. If that results in an empty mask, then an exception is raised.

Feedback, Comments & Corrections

Tapping Points

Constant Value Description
kCGAnnotatedSessionEventTap 2 At the point where events have been annotated to flow to a specific application, or at the point where events are delivered to the application.
kCGHIDEventTap 0 When HIDSystem events enter the server.
kCGSessionEventTap 1 At the point where HIDSystem and remote control events enter a session.

Event Masks

Constant Value Description
kCGEventMaskFlagsChanged 4096 Key flags changed, e.g. modifier keys pressed.
kCGEventMaskForAllEvents -1 Listen for all events.
kCGEventMaskKeyDown 1024 Key Down
kCGEventMaskKeyUp 2048 Key up.
kCGEventMaskLeftMouseDown 2 left mouse-down event
kCGEventMaskLeftMouseDragged 64 left mouse-dragged event
kCGEventMaskLeftMouseUp 4 left mouse-up event
kCGEventMaskMouseMoved 32 mouse-moved event
kCGEventMaskOtherMouseDown &h2000000 other mouse-down event
kCGEventMaskOtherMouseDragged &h8000000 other mouse-dragged event
kCGEventMaskOtherMouseUp &h4000000 other mouse-up event
kCGEventMaskRightMouseDown 8 right mouse-down event
kCGEventMaskRightMouseDragged 128 right mouse-dragged event
kCGEventMaskRightMouseUp 16 right mouse-up event
kCGEventMaskScrollWheel &h400000 Scroll Wheel event.
kCGEventMaskTabletPointer &h800000 Tablet pointer event.
kCGEventMaskTabletProximity &h1000000 Tablet Proximity event.

This class has no sub classes.


The items on this page are in the following plugins: MBS MacCF Plugin.


CGEventMBS   -   CGFontMBS




Links
MBS Xojo PDF Plugins