简体   繁体   English

我如何通过Objective C或Java禁用Mac中的触摸栏功能

[英]How can i disable the touch bar functionality in Mac through Objective C or Java

http://www.imore.com/how-disable-touch-bar-macbook-pro-so-you-can-take-your-exams http://www.imore.com/how-disable-touch-bar-macbook-pro-so-you-can-take-your-exams

This blog talks about disabling the new touch bar on a mac book pro by user. 此博客讨论了由用户在macbook pro上禁用新的触摸栏。

Can achieve the same by using Objective C or JAVA? 通过使用Objective C或JAVA可以达到相同的目的吗?

We can achieve this by setting the NSFunctionBarAPIEnabled boolean value to No. 我们可以通过将NSFunctionBarAPIEnabled布尔值设置为No来实现。

defaults write com.apple.systemuiserver NSFunctionBarAPIEnabled -bool NO 默认写入com.apple.systemuiserver NSFunctionBarAPIEnabled -bool否

You can do the same in objective c by 您可以通过在目标c中执行相同的操作

NSDictionary* myDict = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:@"NSFunctionBarAPIEnabled"];
[[NSUserDefaults standardUserDefaults] registerDefaults:myDict];

Source: http://indiestack.com/2016/12/touch-bar-crash-protection/ 资料来源: http : //indiestack.com/2016/12/touch-bar-crash-protection/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM