Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steveetm/cordova-plugin-touchbar
Cordova plugin to access MacBook Pro's Touch Bar from JavaScript.
https://github.com/steveetm/cordova-plugin-touchbar
cordova cordova-plugin javascript touchbar
Last synced: 19 days ago
JSON representation
Cordova plugin to access MacBook Pro's Touch Bar from JavaScript.
- Host: GitHub
- URL: https://github.com/steveetm/cordova-plugin-touchbar
- Owner: steveetm
- License: other
- Created: 2017-09-25T06:00:54.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-05T07:21:42.000Z (about 7 years ago)
- Last Synced: 2024-04-23T21:31:43.276Z (7 months ago)
- Topics: cordova, cordova-plugin, javascript, touchbar
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Cordova Plugin Touchbar
======A Cordova plugin to access and configure TouchBar on compatible MacBook Pro models from JavaScript.
In its current state this plugin may not useful at all and only serves as a traininground for me
to learn Objective-c and Cordova plugin development.#Example
```
TouchBar.defineTouchBarItems([{
type: "NSButton",
image: TouchBarPlugin.identifiers.images.NSImageNameTouchBarBookmarksTemplate,
title: 'Title',
identifier: 'Button1'
}, {
type: "NSSlider",
title: "",
identifier: 'Slider',
minValue: 0,
maxValue: 100,
}])
.then(() => {
TouchBar.setDefaultItemIdentifiers(['Button1', 'Slider', TouchBarPlugin.identifiers.elements.otherItemsProxy]);
TouchBar.on('Button1', 'tap', () => {
alert('tapped')
});
TouchBar.on('Slider', 'change', function (newValue) {
console.log(newValue)
})
});
```