Programming for the MacBook Pro Touch Bar
Programming for the MacBook Pro Touch Bar
- Subject: Programming for the MacBook Pro Touch Bar
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 14 Apr 2017 14:25:18 -0400
Nobody has responded on the accessibility-dev mailing list, so I'm broadening my inquiry to the cocoa-dev list:
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. VoiceOver proves that this is true. 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?
--
Bill Cheeseman - email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden