diff --git a/README.md b/README.md index d64d217..f33897c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Stream Deck Plugin Template -The `Stream Deck Plugin Template` is a template to let you get started quickly when writing a JavaScript plugin for [Stream Deck](https://developer.elgato.com/documentation/stream-deck/). `Stream Deck Plugin Template` requires Stream Deck 5.0 or later. +The `Stream Deck Plugin Template` is a template to let you get started quickly when writing a JavaScript plugin for [Stream Deck](https://developer.elgato.com/documentation/stream-deck/). `Stream Deck Plugin Template` requires Stream Deck 6.0 or later. ## Description @@ -22,7 +22,7 @@ The `Stream Deck Plugin Template` is a template to let you get started quickly w ## Quick Start Guide -A short guide to help you getting started quickly. +A short guide to help you get started quickly. ### Clone the repo @@ -30,18 +30,35 @@ A short guide to help you getting started quickly. ### Replace Name -`com.elgato.template` with `my.domain.plugin` +Rename the folder as well as any references. + +`com.elgato.template` with `my.domain.plugin-name` + +### Get the latest library + +Be sure `.gitmodules` has been updated to match your new folder name `my.domain.plugin-name` and then pull the latest libraries. + +```git submodule init && git submodule update``` ### Start Coding -You can get starting in app.js! +You can get started in app.js! ```javascript -$SD.onConnected(({actionInfo, appInfo, connection, messageType, port, uuid}) => { - const myAction = new Action('my.domain.plugin.action'); +const myAction = new Action('com.elgato.template.action'); - myAction.onKeyUp(({action, context, device, event, payload}) => { - console.log('Your code goes here!'); - }); +/** + * The first event fired when Stream Deck starts + */ +$SD.onConnected(({ actionInfo, appInfo, connection, messageType, port, uuid }) => { + console.log('Stream Deck connected!'); +}); + +myAction.onKeyUp(({ action, context, device, event, payload }) => { + console.log('Your key code goes here!'); +}); + +myAction.onDialRotate(({ action, context, device, event, payload }) => { + console.log('Your dial code goes here!'); }); ``` diff --git a/src/com.elgato.template.sdPlugin/actions/template/property-inspector/inspector.js b/src/com.elgato.template.sdPlugin/actions/template/property-inspector/inspector.js index 76705e3..9dea582 100644 --- a/src/com.elgato.template.sdPlugin/actions/template/property-inspector/inspector.js +++ b/src/com.elgato.template.sdPlugin/actions/template/property-inspector/inspector.js @@ -1,8 +1,8 @@ -/// +/// /// -$SD.onConnected((jsn) => { - $SD.loadLocalization('../../../'); +$PI.onConnected((jsn) => { + $PI.loadLocalization('../../../'); const form = document.querySelector('#property-inspector'); const { actionInfo, appInfo, connection, messageType, port, uuid } = jsn; @@ -15,8 +15,7 @@ $SD.onConnected((jsn) => { 'input', Utils.debounce(150, () => { const value = Utils.getFormValue(form); - $SD.sendToPlugin(null, value); - $SD.setSettings(null, value); + $PI.setSettings(value); }) ); }); diff --git a/src/com.elgato.template.sdPlugin/app.js b/src/com.elgato.template.sdPlugin/app.js index 2586e8a..2115ab5 100644 --- a/src/com.elgato.template.sdPlugin/app.js +++ b/src/com.elgato.template.sdPlugin/app.js @@ -7,13 +7,13 @@ const myAction = new Action('com.elgato.template.action'); * The first event fired when Stream Deck starts */ $SD.onConnected(({ actionInfo, appInfo, connection, messageType, port, uuid }) => { - console.log('Stream Deck connected!') + console.log('Stream Deck connected!'); }); myAction.onKeyUp(({ action, context, device, event, payload }) => { - console.log('Your code goes here!'); + console.log('Your key code goes here!'); }); -myAction.onSendToPlugin(jsn=>{ - console.log(jsn); -}) \ No newline at end of file +myAction.onDialRotate(({ action, context, device, event, payload }) => { + console.log('Your dial code goes here!'); +}); \ No newline at end of file diff --git a/src/com.elgato.template.sdPlugin/libs b/src/com.elgato.template.sdPlugin/libs index b1bb372..f15f247 160000 --- a/src/com.elgato.template.sdPlugin/libs +++ b/src/com.elgato.template.sdPlugin/libs @@ -1 +1 @@ -Subproject commit b1bb3723180b43240e752816285852920a93c14a +Subproject commit f15f247682e9acb58449807a2949385cd4569eb6 diff --git a/src/com.elgato.template.sdPlugin/manifest.json b/src/com.elgato.template.sdPlugin/manifest.json index 6c061c9..9b87341 100644 --- a/src/com.elgato.template.sdPlugin/manifest.json +++ b/src/com.elgato.template.sdPlugin/manifest.json @@ -26,6 +26,16 @@ { "Icon": "actions/template/assets/actionimage", "Name": "Example Action", + "Controllers": ["Keypad", "Encoder"], + "Encoder": { + "layout": "$B1", + "TriggerDescription": { + "Rotate": "Describe the rotation", + "Push": "Describe the encoder push", + "Touch": "Describe the touch", + "LongTouch": "Describe the long touch" + } + }, "States": [ { "Image": "actions/template/assets/action"