updated libs and readme

This commit is contained in:
Zack Hoherchak 2022-12-16 13:38:08 -05:00
commit 3411f3f9a2
5 changed files with 46 additions and 20 deletions

View file

@ -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!');
});
```

View file

@ -1,8 +1,8 @@
/// <reference path="../../../libs/js/stream-deck.js" />
/// <reference path="../../../libs/js/property-inspector.js" />
/// <reference path="../../../libs/js/utils.js" />
$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);
})
);
});

View file

@ -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);
})
myAction.onDialRotate(({ action, context, device, event, payload }) => {
console.log('Your dial code goes here!');
});

@ -1 +1 @@
Subproject commit b1bb3723180b43240e752816285852920a93c14a
Subproject commit f15f247682e9acb58449807a2949385cd4569eb6

View file

@ -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"