1

I am creating a NSTouchBar for my app. When the bar displays, I see this ESC icon on the left and these other icons on the right:

enter image description here

Is there a way to get rid of them and have the full bar area available?

Duck
  • 34,902
  • 47
  • 248
  • 470
  • Nope. The "esc" key and the "control strip" on the right can't be removed via public APIs. You can change the content of "esc", though, like "done" or anything else. – Eric Aya Jun 29 '17 at 14:58
  • please make your comment an answer, so I can accept. thanks. Ah, and btw, how do I change the esc to something else? – Duck Jun 29 '17 at 14:59

1 Answers1

2

The icons on the right are the "control strip".

The "esc" key and the "control strip" on the right can't be removed via public APIs. In the documentation they say it's "always available".

You can change the content of "esc" to something else, though, like "done" or anything, even an icon, by using escapeKeyReplacementItemIdentifier with the NSTouchBarItem.

There's ways to customize the control strip and even to remove it, but I didn't find any public API for that: Apple considers that this choice should be left to the user, via the system preferences, and can't be forced programmatically.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
  • You're welcome. I've made a few edits with more information. – Eric Aya Jun 29 '17 at 15:12
  • I have created [this other question](https://stackoverflow.com/questions/44862210/replacing-the-esc-button-on-a-nstouchbar), specifically about replacing the ESC key... if you want to answer... – Duck Jul 01 '17 at 14:52