Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Too bad there isn't a way to have your app control the touch bar even when it isn't in focus. I would have liked to write a background application that overrides it for personal use. I already have one that does that for the caps lock key.


That's a nice idea, But I could only imagine it would lead to chaos as apps start fighting each other for Touch Bar rights.


If I were in charge of Apple I'd make the app have to have accessibility rights.


How come? That seems like a totally unrelated access right to repurpose for this?


"Accessibility" is kind of the catch all super-permission to give to hooks into greater parts of the operating system.

For example, Dropbox requires it for some features, as does an App that hides menubar items.


That's also how keyboard remapping apps (like Karabiner) work, so it seems plausible here at least.


I bet there could be some accessibility-related use for the touch bar. Also, accessibility is already tied to completely unrelated things like event taps.



You mean like the menu bar?


I couldn't find an API for it, but some Apple apps do in fact do this. I've seen three examples of it:

- Media playback: When a song or a video is playing in a background app, there is an extra button in the system button part on the right that lets you access a media control strip. From it you can pause the current video / audio and even scrub through it.

- Xcode debugging: While Xcode is attached to a running process, there's a button in the system button part on the right side of the touch bar lets you access a debugging control strip, which lets you pause execution and step through the program. This access button is actually in the same place as the media control button, and in cases where both would be shown, the media control button wins.

- QuickTime screen recording: When you start recording the screen from QuickTime, the current recording time + a stop button is displayed in a touch bar overlay even if you focus a different app. However, once you do switch to a different app, you can close the overlay, and it minimizes into that same button slot on the right of the touch bar.

It surely would be nice to be able to do these things without private APIs, but I couldn't find anything so far.


Xcode 8.1 does that (visible in the TouchBar simulator). They add a global key to control the debugger (Pause/Resume program execution, toggle breakpoints…) while you're in your app, and away from Xcode: https://cl.ly/0v0z3b2S3Q0a




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: