问题
Apple just announced the new MacBook with the touch bar. Are there APIs that app developers can use? I can't seem to find any online yet.
Does it support access from the browser via JavaScript? WebKit has force touch APIs to support it on four runs touch trackpad) so I'm guessing it'll be pretty useful if they release this one too. Is anything out yet?
Also how to debug and test for touch bar functions, is there some 'MAC EMULATOR' sort of thing?
回答1:
I think this option is for native client, it won’t be able to manipulate in browser, unless the browser doesn’t support it
If you're writing Native Client (JavaScript only), then here is a repository.
UPDATE: It is already supported by Electron.
回答2:
There is a native API: https://developer.apple.com/reference/appkit/nstouchbar
I don't know whether there will be support via Javascript
来源:https://stackoverflow.com/questions/40292937/has-apple-released-apis-for-touch-bar-yet