Is anybody able to provide guidance or useful links regarding the use of Quartz Event Taps to monitor or interecept gesture events posted by the 2016 MacBook Pro with Touch Bar?
Apple's current Touch Bar documentation says very little about programming for the Touch Bar, but it does state that the Touch Bar posts gesture events that can be monitored by the Accessibility API, which includes Quartz Event Taps. My further research shows the following:
A limited ability to monitor global gesture events posted to any application from a trackpad was added to Cocoa's NSEvent class some time ago in the form of the -addGlobalMonitorForEventsMatchingMask:handler: method, and Cocoa's NSGestureRecognizer class can be used to examine them. However, NSEvent's global monitoring is expressly documented as refusing to let you modify or intercept gesture events from other applications.
But the Quartz Event Taps API in the CoreGraphics framework apparently does allow you to modify or intercept gesture events, as well as traditional events, posted to other applications. I say this because I see a "CGGesturePhases" data type declared in Apple's CGEventTypes.h header file.
Unfortunately, none of the Event Taps aspects of this is documented or explained by Apple, and I cannot even find any third-party commentary or sample code dealing with it. Can anybody help?
|