Skip to content

EmilyxFox/go-streamdeck-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StreamDeck SDK for Go

Welcome to a scuffed StreamDeck SDK written for Go.

Features include

  • Potential to work
  • Incomplete documentation
  • Doubtful WebSocket handling

Installation

go get github.com/emilyxfox/go-streamdeck-sdk/streamdeck

Instructions

Step 1:

Create a new struct that embeds streamdeck.BaseAction and implements the event handler methods you need.

package main

import (
	"log"
	"strconv"

	"github.com/emilyxfox/streamdeck-sdk/streamdeck"
)

type MyCounterAction struct {
	streamdeck.ActionConfig
}

var counter uint32

func (a *MyCounterAction) HandleKeyDown(event *streamdeck.KeyDownEvent) {
	log.Printf("Handling KeyDownEvent for UUID: %s, Event: %+v", a.UUID, event)
	counter++
	event.SetTitle(strconv.FormatUint(uint64(counter), 10))
}

func (a *MyCounterAction) HandleWillAppear(event *streamdeck.WillAppearEvent) {
	event.SetTitle(strconv.FormatUint(uint64(counter), 10))
}

Step 2:

In your main function, register the action, connect to the WebSocket, and start listening for events.

package main

import (
	"log"

	"github.com/emilyxfox/streamdeck-sdk/streamdeck"
)

func main() {
	// Create and register your custom action
	action := &MyCounterAction{
		ActionConfig: streamdeck.ActionConfig{UUID: "com.emilyxfox.counter.counter"},
	}
	streamdeck.RegisterAction(action)

	// Start listening for events
	streamdeck.StartPlugin()
}

Documentation

For more information and instructions on how to structure your plugin please refer to the official Stream Deck docs.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages