Re: More on MacBook Pro Touch Bar
Re: More on MacBook Pro Touch Bar
- Subject: Re: More on MacBook Pro Touch Bar
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 17 Apr 2017 12:30:18 -0400
On Apr 14, 2017, at 2:22 PM, Bill Cheeseman < email@hidden> wrote:
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?
Using trial and error, I have learned a lot about this over the weekend.
Passing kCGEventMaskForAllEvents when creating an event tap causes all hardware input events to be reported, including all events posted by the Touch Bar. It appears that all Touch Bar events are reported as NSEventTypeDirectTouch (37) events. "Direct Touch" means touching a screen directly -- the Touch Bar is considered to be a second screen in that sense. (Touching a trackpad is called "indirect touch" because you aren't touching a screen directly.)
This behavior of Quartz Event Taps is very different from the behavior of Cocoa's -addGlobalMonitorForEventsMatchingMask:handler: method. In the Cocoa global monitoring method, most Touch Bar events are not reported at all, but some Touch Bar events are reported to be traditional Key Down-Key Up events. In the Cocoa method, the Touch Bar items that are reported as traditional keyboard events are the Escape ("esc") and Function (e.g., "F1", "F2") items, which are designed to be treated exactly like the equivalent hardware keys on the traditional Mac keyboards that the Touch Bar replaces.
The marked difference in behavior between Quartz Event Taps and the Cocoa global event monitoring method makes clear that Apple's Touch Bar documentation is targeted solely at developers of non-assistive applications. Apple's statement that there is no API for the Touch Bar and that developers should treat Touch Bar input the same way they treat all user input simply is not true for developers of assistive applications. I have put together an experimental application that monitors Touch Bar events. Next I will try modifying and intercepting them.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden