streamdeck

package module
v1.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2023 License: Apache-2.0 Imports: 11 Imported by: 1

README

Go Report Card

Luzifer / streamdeck

streamdeck is a library and management tool to use an Elgato StreamDeck on a Linux system written in Go.

Supported devices:

  • Elgato StreamDeck Original V2 (15 keys, ID 0fd9:006d)
  • Elgato StreamDeck XL (32 keys, ID 0fd9:006c)
  • Elgato StreamDeck Mini (6 keys, ID 0fd9:0063)

Usage

  • For library usage see godoc
  • For usage of the tool see the Wiki

Documentation

Index

Constants

View Source
const (
	// Streamdeck Original V2 (0fd9:006d) 15 keys
	StreamDeckOriginalV2 uint16 = 0x006d
	// Stremdeck XL (0fd9:006c) 32 keys
	StreamDeckXL uint16 = 0x006c
	// StreamDeck Mini (0fd9:0063) 6 keys
	StreamDeckMini uint16 = 0x0063
	// StreamDeck Mini V2 (0fd9:0090) 6 keys
	StreamDeckMiniV2 uint16 = 0x0090
)
View Source
const VendorElgato = 0x0fd9

Variables

View Source
var DeckToName = map[uint16]string{
	StreamDeckOriginalV2: "StreamDeck Original V2",
	StreamDeckXL:         "StreamDeck XL",
	StreamDeckMini:       "StreamDeck Mini",
	StreamDeckMiniV2:     "StreamDeck Mini V2",
}

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client manages the connection to the StreamDeck

func New

func New(devicePID uint16) (*Client, error)

New creates a new Client for the given device (see constants for supported types)

func (Client) ClearAllKeys

func (c Client) ClearAllKeys() error

ClearAllKeys fills all keys with solid black

func (Client) ClearKey

func (c Client) ClearKey(keyIdx int) error

ClearKey fills a key with solid black

func (Client) Close

func (c Client) Close() error

Close closes the underlying HID connection

func (Client) FillColor

func (c Client) FillColor(keyIdx int, col color.RGBA) error

FillColor fills a key with a solid color

func (Client) FillImage

func (c Client) FillImage(keyIdx int, img image.Image) error

FillImage fills a key with an image

func (Client) FillPanel

func (c Client) FillPanel(img image.RGBA) error

FillPanel slices a big image and fills the keys with the parts

func (Client) GetFimwareVersion

func (c Client) GetFimwareVersion() (string, error)

GetFimwareVersion retrieves the firmware version

func (Client) IconSize

func (c Client) IconSize() int

IconSize returns the required icon size for the StreamDeck

func (Client) NumKeys

func (c Client) NumKeys() int

NumKeys returns the number of keys available on the StreamDeck

func (c Client) ResetToLogo() error

ResetToLogo restores the original Elgato StreamDeck logo

func (Client) Serial

func (c Client) Serial() (string, error)

Serial returns the device serial

func (Client) SetBrightness

func (c Client) SetBrightness(pct int) error

SetBrightness sets the brightness of the keys (0-100)

func (Client) Subscribe

func (c Client) Subscribe() <-chan Event

Subscribe returns a channel to listen for incoming events

type Event

type Event struct {
	Key  int
	Type EventType
}

Event represents a state change on a button

type EventType

type EventType uint8

EventType represents the state of a button (Up / Down)

const (
	EventTypeUp EventType = iota
	EventTypeDown
)

Directories

Path Synopsis
cmd
streamdeck Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL