Questions tagged [nstouchbar]

An object that provides dynamic contextual controls in the Touch Bar of supported models of MacBook Pro.

NSTouchBar provides an interface to the 2016 MacBook Pro's 'Touch Bar', a multitouch screen above the keyboard.

See the NSTouchBar documentation for more information.

85 questions
2
votes
1 answer

How to hide control strip of nstouchbar programmatically?

Is there any way to hide controlstrip of NSTouchBar programmatically? NSPopOverTouchBarItem has a private property showsControlStrip. But how do I make use of this private property? Thank you.
sharmada
  • 131
  • 1
  • 6
2
votes
1 answer

Adding NSTouchBar support after main window has been created

I'm trying to add support for exposing NSTouchBar buttons via a plugin to an application that I cannot otherwise modify. The plugin, a shared library, is loaded at runtime after the main window has been created. I've created an AppDelegate as…
dsvensson
  • 1,401
  • 12
  • 20
2
votes
2 answers

How to keep my TouchBar active when not focused

I'm trying to create a proxy app to provide touchbar functionality for an existing closed source app. I am able to communicate with the app through an api, but my touchbar disappears when it's not focused. In the NSTouchBar documentation it says:…
Sharph
  • 83
  • 1
  • 7
2
votes
3 answers

How to check if machine has a Touch Bar

Is there any API to check whether the running machine has a touch bar (or Xcode's touch bar simulator)? I have some methods to be invoked only if a touch bar exists. If I just check the nullability of touchBar property of a responder, it…
1024jp
  • 2,058
  • 1
  • 16
  • 25
2
votes
0 answers

NSTouchBar delegate never called

I'm tryng to extend my application supporting touchbar but touch bar delegate method is never called. : - (nullable NSTouchBarItem *)touchBar:(NSTouchBar *)touchBar makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier This is the code of my…
christian mini
  • 1,662
  • 20
  • 39
1
vote
0 answers

SwiftUI equivalent of popoverTouchBar and pressAndHoldTouchBar

SwiftUI Touch Bar support seems quite limited. Is there an equivalent of popoverTouchBar and pressAndHoldTouchBar? I tried doing a popover as follows: .touchBar { Button(action: { self.showRadiusTouchBarSlider.toggle() }) { …
Taylor
  • 5,871
  • 2
  • 30
  • 64
1
vote
1 answer

How can I use NSTouchBar in SwiftUI MacOS App?

I am trying to add TouchBar support for my MacOS app in SwiftUI. I found that I have to call .. NSApp.isAutomaticCustomizeTouchBarMenuItemEnabled = true .. in my AppDelegate. But what is now the best way to create the TouchBar? Can I add it…
davidev
  • 7,694
  • 5
  • 21
  • 56
1
vote
0 answers

How to simulate a key press in NSTouchBar with NSButton?

Looking to add functionality to an NSButton, which when clicked, performs the same keystrokes as Command + "B". Have tried setting the NSButton.keyequivalent as well as NSButton.performKeyEquivalent, but with this case, I cannot find an event to…
jNiuk
  • 81
  • 9
1
vote
1 answer

NSTouchBar integration not calling

I am integrating TouchBar support to my App. I used the how to from Rey Wenderlich and implemented everything as follows: If self.touchBarArraygot filled the makeTouchBar() Method returns the NSTouchBar object. If I print out some tests the…
Kevin Lieser
  • 951
  • 1
  • 9
  • 25
1
vote
0 answers

Mac Touchbar App - Add Shortcut to bring touch bar to front

i am currently developing a Mac TouchBar application. Now I want to add a shortcut to this application so that I can bring the touch bar into front when another application is active. The TouchBar application TouchSwitcher have this feature. How…
user3143691
  • 1,533
  • 3
  • 11
  • 19
1
vote
0 answers

How to permanently display the Touch Bar from one specific app when running?

I've developed an app based on NodeJS with Electron for a web agency and try to extend it to the touch bar functionality of the MacBook Pro. Developers launch the app once, which then automatically starts various processes in the background, such as…
Foddy
  • 467
  • 1
  • 6
  • 15
1
vote
1 answer

Is it possible to write a custom TouchBar app for an existing application?

I have tried looking for an answer to this but can't seem to see anything about it. I have a piece of software on my laptop (not written by me), that I want to customise. Some of the tasks I do are very repetitive, and could be simplified by just…
user2397282
  • 3,798
  • 15
  • 48
  • 94
1
vote
1 answer

Can I programmatically change the background color of the touch bar?

Can I change the background color of the MacBook Pro touch bar programmatically (for my macOS app)? I am afraid that there is no API for doing that, but I am asking you anyway!
Nisba
  • 3,210
  • 2
  • 27
  • 46
1
vote
0 answers

Swift Access Objects In View Controller From Window Controller

I'm just getting into development on mac os and I made a simple app for the touch bar that allows you to change the color (with a nscolorpicker) of a label that is also on the touch bar. Now I would like to get the same effect on the actual window…
user265889
  • 667
  • 1
  • 10
  • 24
1
vote
1 answer

How to detect a Pan Gesture inside a NSTouchBarView

Is it possible to detect a finger pan on a NSTouchBarView? Sorry for the lack of code but I don't even know where to start. MacOS is not made for finger touches but the TouchBar is but I do not see how to do it on a NSTouchBarView
Duck
  • 34,902
  • 47
  • 248
  • 470