elgatosf / streamdeck-plugin-template

A starting place for a new JavaScript Stream Deck plugin.
MIT License
180 stars 69 forks source link

myAction.onKeyUp won't work #11

Closed sohneg closed 7 months ago

sohneg commented 7 months ago

I did not change much onConnected works but the onKeyUp won't do anything. Also linking the project into the plugin folder won't work as expected. I can't see the plugin in the stream deck then. Only with DistributionTool i can see it

/// <reference path="libs/js/action.js" />
/// <reference path="libs/js/stream-deck.js" />

const myAction = new Action('ch.sohneg.server-manager');

/**
 * 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!');
});
ChekTek commented 7 months ago

Hi @sohneg

You'll want to make sure that the action UUID in the manifest.json and the UUID you provide to the Action constructor match. For example, the UUID of the plugin might be ch.sohneg.server-manager, then one of your actions might be ch.sohneg.server-manager.start. In this scenario you would initialize your action with code something like this

const myAction = new Action('ch.sohneg.server-manager.start');

To add the plugin to Stream Deck without using the DistributionTool, you may want to check out our guide to using Symlinks here: https://docs.elgato.com/sdk/plugins/getting-started#4.-add-the-plugin-to-stream-deck