Quartz Event Taps and Touch Bar
Quartz Event Taps and Touch Bar
- Subject: Quartz Event Taps and Touch Bar
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 21 Apr 2017 09:54:43 -0400
I announced today on Apple's accessibility-dev mailing list that I have discovered that the MacBook Pro (Late 2016) Touch Bar in macOS Sierra 10.12.2 and later supports AppleScript's GUI Scripting technology using the Accessibility API as well as supporting Quartz Event Taps. Apple's API Reference for the NSTouchBar class says "Because the Touch Bar is designed to work with AppKit, it is fully accessible."
I posted an example AppleScript to the applescript-users mailing list this morning. In this message to the cocoa-dev list, I am posting the AppDelegate.m Objective-C source file from a companion Cocoa application I have written, showing how to use Quartz Event Taps to monitor the Touch Bar in another application and to intercept and modify or replace the Touch Bar event. This ability is necessary in order to write assistive applications for users with disabilities on a Touch Bar-equipped Mac.
This Objective-C application installs an event tap for the active application and receives every touch emanating from that application's Touch Bar. The most useful information contained in the touch is the location of the touch within the Touch Bar. You can then turn to the Accessibility API, illustrated in the sample AppleScript I posted this morning to applescript-users, to identify which button was located at that location in the Touch Bar and information about what it was intended to do.
Because of its length, I will post the first and second halves of the AppDelegate.m file in two separate messages to follow immediately.
--
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