streamdeck

package module
v0.0.0-...-3d55b1e Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: BSD-3-Clause Imports: 17 Imported by: 0

README

Stream Deck Go Library

A pure Go library for interacting with Elgato Stream Deck devices. This library works on Linux, macOS, and Windows.

[!IMPORTANT] Disclaimer: This library is NOT supported or endorsed by Elgato, Corsair, or any related company. Use it at your own risk!

Features

  • Cross-platform support - Works on Linux, macOS, and Windows
  • Pure Go implementation - No libusb/hidapi dependency
  • Multiple device support - Supports various Stream Deck models
  • Input event handling - Register callbacks for input events
  • Image display - Set custom images on keys with automatic scaling
  • Touch point control - Set colors for touch points on supported models
  • Info bar support - Control the info bar display on supported models
  • Touch strip support - Control the touch strip display on supported models
  • Device management - Control brightness, reset, and get device information

Supported Devices

Model Product ID Keys Touch Points Dials Info Bar Touch Strip
Stream Deck Mini 0x0063 6
Stream Deck V2 0x006d 15
Stream Deck MK.2 0x0080 15
Stream Deck Plus 0x0084 8 4
Stream Deck Neo 0x009a 8 2

Supporting additional models would require hardware access for the library maintainer. Adding support based purely on data reverse-engineered from other libraries is not an option. If you have the means to support adding more devices, please contact the maintainer for additional information.

Motivation

This work started as an internal library for the mister-macropads project, which was never published there. The API worked out so nicely that I decided to make it a standalone public library.

The design is heavily inspired by the client library for my open hardware macropad octokeyz (rafaelmartins.com/p/octokeyz), and it relies on my pure Go USB HID library (rafaelmartins.com/p/usbhid).

Being pure Go makes it easier to cross-compile for restricted environments, like the MiSTer FPGA Linux-based operating system. The library also strives to implement and consume the interfaces defined by Go standard libraries for improved compatibility.

This library does not have any tooling to generate images; users are encouraged to generate any image.Image and the library will make it fit the desired viewport. There are Get*ImageRectangle() functions to recover the geometry of the viewport if users want to generate images the right size and avoid scaling.

Installation

go get rafaelmartins.com/p/streamdeck

Quick Start

package main

import (
	"image/color"
	"log"

	"rafaelmartins.com/p/streamdeck"
)

func main() {
	// get the first available stream deck device
	devices, err := streamdeck.Enumerate()
	if err != nil {
		log.Fatal(err)
	}
	if len(devices) == 0 {
		log.Fatal("No Stream Deck devices found")
	}
	device := devices[0]

	// open the device
	if err := device.Open(); err != nil {
		log.Fatal(err)
	}
	defer device.Close()

	// set key 1 to red
	red := color.RGBA{255, 0, 0, 255}
	if err := device.SetKeyColor(streamdeck.KEY_1, red); err != nil {
		log.Print(err)
		return
	}

	// add a key handler
	if err := device.AddKeyHandler(streamdeck.KEY_1, func(d *streamdeck.Device, k *streamdeck.Key) error {
		log.Printf("Key %s pressed!", k)
		duration := k.WaitForRelease()
		log.Printf("Key %s released! %s", k, duration)
		return nil
	}); err != nil {
		log.Print(err)
		return
	}

	// listen for input events
	if err := device.Listen(nil); err != nil {
		log.Print(err)
		return
	}
}

API Reference

Please check pkg.go.dev/rafaelmartins.com/p/streamdeck for complete API documentation.

Examples

See the examples directory for complete working examples:

  • Basic Usage - Simple input handling and image setting with complete error handling
  • Advanced Features - Info bar, touch points, dials, touch strip, long press detection, and dynamic effects
  • Image Examples - Different ways to set images including embedded files, patterns, and generated graphics
  • Device Information - Device enumeration, capability detection, and information retrieval
  • Multi-Device - Working with multiple Stream Deck devices simultaneously with synchronized effects
Running Examples

Each example is a complete, standalone program. To run them:

# Basic usage example (pass a serial number as argument if multiple devices connected)
go run examples/basic/main.go

# Advanced features (pass a serial number as argument if multiple devices connected. requires a device with info bar/touch points for full demo)
go run examples/advanced/main.go

# Image examples with patterns and embedded icons (pass a serial number as argument if multiple devices connected)
go run examples/images/main.go

# Device information and enumeration
go run examples/device-info/main.go

# Multi-device synchronization (requires multiple devices for full demo)
go run examples/multi-device/main.go

License

This library is distributed under a BSD 3-Clause license.

Documentation

Overview

Package streamdeck provides support for interacting with Elgato Stream Deck devices connected to a computer without using vendor-provided software.

It is written in pure Go and works on Linux, macOS and Windows.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDeviceEnumerationFailed      = usbhid.ErrDeviceEnumerationFailed
	ErrDeviceFailedToClose          = usbhid.ErrDeviceFailedToClose
	ErrDeviceFailedToOpen           = usbhid.ErrDeviceFailedToOpen
	ErrDeviceInfoBarNotSupported    = errors.New("device hardware does not includes an info bar")
	ErrDeviceIsClosed               = usbhid.ErrDeviceIsClosed
	ErrDeviceIsOpen                 = usbhid.ErrDeviceIsOpen
	ErrDeviceLocked                 = usbhid.ErrDeviceLocked
	ErrDeviceTouchPointNotSupported = errors.New("device hardware does not includes touch points")
	ErrDeviceTouchStripNotSupported = errors.New("device hardware does not includes a touch strip")
	ErrDialHandlerInvalid           = errors.New("dial handler is not valid")
	ErrDialInvalid                  = errors.New("dial is not valid")
	ErrGetFeatureReportFailed       = usbhid.ErrGetFeatureReportFailed
	ErrGetInputReportFailed         = usbhid.ErrGetInputReportFailed
	ErrImageInvalid                 = errors.New("image is not valid")
	ErrKeyHandlerInvalid            = errors.New("key handler is not valid")
	ErrKeyInvalid                   = errors.New("key is not valid")
	ErrMoreThanOneDeviceFound       = usbhid.ErrMoreThanOneDeviceFound
	ErrNoDeviceFound                = usbhid.ErrNoDeviceFound
	ErrReportBufferOverflow         = usbhid.ErrReportBufferOverflow
	ErrSetFeatureReportFailed       = usbhid.ErrSetFeatureReportFailed
	ErrSetOutputReportFailed        = usbhid.ErrSetOutputReportFailed
	ErrTouchPointHandlerInvalid     = errors.New("touch point handler is not valid")
	ErrTouchPointInvalid            = errors.New("touch point is not valid")
	ErrTouchStripHandlerInvalid     = errors.New("touch strip handler is not valid")
)

Errors returned from streamdeck package may be tested against these errors with errors.Is.

Functions

This section is empty.

Types

type Device

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

Device represents an Elgato Stream Deck device and provides methods to interact with it, including setting key images, handling input events, and controlling device settings.

func Enumerate

func Enumerate() ([]*Device, error)

Enumerate lists the supported Elgato Stream Deck devices connected to the computer.

func GetDevice

func GetDevice(serialNumber string) (*Device, error)

GetDevice returns an Elgato Stream Deck device found connected to the machine that matches the provided serial number. If serial number is empty and only one device is connected, this device is returned, otherwise an error is returned.

func (*Device) AddDialRotateHandler

func (d *Device) AddDialRotateHandler(di DialID, fn DialRotateHandler) error

AddDialRotateHandler registers a DialSwitchHandler callback to be called whenever the given dial is rotated.

func (*Device) AddDialSwitchHandler

func (d *Device) AddDialSwitchHandler(di DialID, fn DialSwitchHandler) error

AddDialSwitchHandler registers a DialSwitchHandler callback to be called whenever the given dial is pressed.

func (*Device) AddKeyHandler

func (d *Device) AddKeyHandler(key KeyID, fn KeyHandler) error

AddKeyHandler registers a KeyHandler callback to be called whenever the given key is pressed.

func (*Device) AddTouchPointHandler

func (d *Device) AddTouchPointHandler(tp TouchPointID, fn TouchPointHandler) error

AddTouchPointHandler registers a TouchPointHandler callback to be called whenever the given touch point is pressed.

func (*Device) AddTouchStripSwipeHandler

func (d *Device) AddTouchStripSwipeHandler(fn TouchStripSwipeHandler) error

AddTouchStripSwipeHandler registers a TouchStripSwipeHandler callback to be called whenever the touch strip is swiped.

func (*Device) AddTouchStripTouchHandler

func (d *Device) AddTouchStripTouchHandler(fn TouchStripTouchHandler) error

AddTouchStripTouchHandler registers a TouchStripTouchHandler callback to be called whenever the touch strip is touched.

func (*Device) ClearInfoBar

func (d *Device) ClearInfoBar() error

ClearInfoBar clears the info bar display available on some Elgato Stream Deck models.

func (*Device) ClearKey

func (d *Device) ClearKey(key KeyID) error

ClearKey clears the Elgato Stream Deck key background display.

func (*Device) ClearTouchPoint

func (d *Device) ClearTouchPoint(tp TouchPointID) error

ClearTouchPoint clears the color set to a touch point strip available in some Elgato Stream Deck models.

func (*Device) ClearTouchStrip

func (d *Device) ClearTouchStrip() error

ClearTouchStrip clears the touch strip display available on some Elgato Stream Deck models.

func (*Device) ClearTouchStripWithRectangle

func (d *Device) ClearTouchStripWithRectangle(rect image.Rectangle) error

ClearTouchStripWithRectangle clears the provided rectangle of the touch strip display available on some Elgato Stream Deck models.

func (*Device) Close

func (d *Device) Close() error

Close closes the Elgato Stream Deck device.

func (*Device) ForEachDial

func (d *Device) ForEachDial(cb func(di DialID) error) error

ForEachDial calls the provided callback function for each dial available on the Elgato Stream Deck device, passing the DialID as an argument.

func (*Device) ForEachKey

func (d *Device) ForEachKey(cb func(k KeyID) error) error

ForEachKey calls the provided callback function for each key available on the Elgato Stream Deck device, passing the KeyID as an argument.

func (*Device) ForEachTouchPoint

func (d *Device) ForEachTouchPoint(cb func(tp TouchPointID) error) error

ForEachTouchPoint calls the provided callback function for each touch point available on the Elgato Stream Deck device, passing the TouchPointID as an argument.

func (*Device) GetDialCount

func (d *Device) GetDialCount() byte

GetDialCount returns the number of dials available on the Elgato Stream Deck device.

func (*Device) GetFirmwareVersion

func (d *Device) GetFirmwareVersion() (string, error)

GetFirmwareVersion returns the firmware version of the Elgato Stream Deck device.

func (*Device) GetInfoBarImageRectangle

func (d *Device) GetInfoBarImageRectangle() (image.Rectangle, error)

GetInfoBarImageRectangle returns an image.Rectangle representing the geometry of the info bar display available on some Elgato Stream Deck models.

func (*Device) GetInfoBarSupported

func (d *Device) GetInfoBarSupported() bool

GetInfoBarSupported returns a boolean reporting if the Elgato Stream Deck device includes an info bar display.

func (*Device) GetKeyCount

func (d *Device) GetKeyCount() byte

GetKeyCount returns the number of keys available on the Elgato Stream Deck device.

func (*Device) GetKeyImageRectangle

func (d *Device) GetKeyImageRectangle() (image.Rectangle, error)

GetKeyImageRectangle returns an image.Rectangle representing the geometry of the Elgato Stream Deck key background displays.

func (*Device) GetModelID

func (d *Device) GetModelID() string

GetModelID returns a string identifier of the Elgato Stream Deck device model.

func (*Device) GetModelName

func (d *Device) GetModelName() string

GetModelName returns the Elgato Stream Deck device model name.

func (*Device) GetSerialNumber

func (d *Device) GetSerialNumber() string

GetSerialNumber returns the serial number of the Elgato Stream Deck device.

func (*Device) GetTouchPointCount

func (d *Device) GetTouchPointCount() byte

GetTouchPointCount returns the number of touch points available on the Elgato Stream Deck device, if supported.

func (*Device) GetTouchStripImageRectangle

func (d *Device) GetTouchStripImageRectangle() (image.Rectangle, error)

GetTouchStripImageRectangle returns an image.Rectangle representing the geometry of the touch strip display available on some Elgato Stream Deck models.

func (*Device) GetTouchStripSupported

func (d *Device) GetTouchStripSupported() bool

GetTouchStripSupported returns a boolean reporting if the Elgato Stream Deck device includes an touch strip display.

func (*Device) IsOpen

func (d *Device) IsOpen() bool

IsOpen checks if the Elgato Stream Deck device is open and available for usage.

func (*Device) Listen

func (d *Device) Listen(errCh chan error) error

Listen listens to input events from the Elgato Stream Deck device and calls handler callbacks as required.

errCh is an error channel to receive errors from the input handlers. If set to a nil channel, errors are sent to standard logger. Errors are sent non-blocking.

func (*Device) Open

func (d *Device) Open() error

Open opens the Elgato Stream Deck device for usage.

func (*Device) Reset

func (d *Device) Reset() error

Reset resets the Elgato Stream Deck device.

Please note that this will close the connection, because this is similar to power cycling the device. This function won't try to reconnect.

func (*Device) SetBrightness

func (d *Device) SetBrightness(perc byte) error

SetBrightness sets the Elgato Stream Deck device brightness, in percent.

func (*Device) SetInfoBarColor

func (d *Device) SetInfoBarColor(c color.Color) error

SetInfoBarColor sets a color to an Elgato Stream Deck info bar display available on some Elgato Stream Deck models.

func (*Device) SetInfoBarImage

func (d *Device) SetInfoBarImage(img image.Image) error

SetInfoBarImage draws a given image.Image to the info bar display available on some Elgato Stream Deck models. The image is scaled as needed.

func (*Device) SetInfoBarImageFromFS

func (d *Device) SetInfoBarImageFromFS(ffs fs.FS, name string) error

SetInfoBarImageFromFS draws an image from a filesystem to the info bar display available on some Elgato Stream Deck models. The image is loaded from a filesystem, decoded and scaled as needed.

func (*Device) SetInfoBarImageFromFile

func (d *Device) SetInfoBarImageFromFile(name string) error

SetInfoBarImageFromFile draws an image from a file to the info bar display available on some Elgato Stream Deck models. The image is loaded, decoded and scaled as needed.

func (*Device) SetInfoBarImageFromReadCloser

func (d *Device) SetInfoBarImageFromReadCloser(r io.ReadCloser) error

SetInfoBarImageFromReadCloser draws an image from an io.ReadCloser to the info bar display available on some Elgato Stream Deck models. The ReadCloser is automatically closed after reading.

func (*Device) SetInfoBarImageFromReader

func (d *Device) SetInfoBarImageFromReader(r io.Reader) error

SetInfoBarImageFromReader draws an image from an io.Reader to the info bar display available on some Elgato Stream Deck models. The image is decoded and scaled as needed.

func (*Device) SetKeyColor

func (d *Device) SetKeyColor(key KeyID, c color.Color) error

SetKeyColor sets a color to an Elgato Stream Deck key background display.

func (*Device) SetKeyImage

func (d *Device) SetKeyImage(key KeyID, img image.Image) error

SetKeyImage draws a given image.Image to an Elgato Stream Deck key background display. The image is scaled as needed.

func (*Device) SetKeyImageFromFS

func (d *Device) SetKeyImageFromFS(key KeyID, ffs fs.FS, name string) error

SetKeyImageFromFS draws an image from a filesystem to an Elgato Stream Deck key background display. The image is loaded from a filesystem, decoded and scaled as needed.

func (*Device) SetKeyImageFromFile

func (d *Device) SetKeyImageFromFile(key KeyID, name string) error

SetKeyImageFromFile draws an image from a file to an Elgato Stream Deck key background display. The image is loaded, decoded and scaled as needed.

func (*Device) SetKeyImageFromReadCloser

func (d *Device) SetKeyImageFromReadCloser(key KeyID, r io.ReadCloser) error

SetKeyImageFromReadCloser draws an image from an io.ReadCloser to an Elgato Stream Deck key background display. The ReadCloser is automatically closed after reading.

func (*Device) SetKeyImageFromReader

func (d *Device) SetKeyImageFromReader(key KeyID, r io.Reader) error

SetKeyImageFromReader draws an image from an io.Reader to an Elgato Stream Deck key background display. The image is decoded and scaled as needed.

func (*Device) SetTouchPointColor

func (d *Device) SetTouchPointColor(tp TouchPointID, c color.Color) error

SetTouchPointColor sets a color to the touch point strip available in some Elgato Stream Deck models.

func (*Device) SetTouchStripColor

func (d *Device) SetTouchStripColor(c color.Color) error

SetTouchStripColor sets a color to the whole touch strip display available on some Elgato Stream Deck models.

func (*Device) SetTouchStripColorWithRectangle

func (d *Device) SetTouchStripColorWithRectangle(c color.Color, rect image.Rectangle) error

SetTouchStripColorWithRectangle sets a color to the provided rectangle of the touch strip display available on some Elgato Stream Deck models.

func (*Device) SetTouchStripImage

func (d *Device) SetTouchStripImage(img image.Image) error

SetTouchStripImage draws a given image.Image to the touch strip display available on some Elgato Stream Deck models. The image is scaled as needed to fit the whole display.

func (*Device) SetTouchStripImageFromFS

func (d *Device) SetTouchStripImageFromFS(ffs fs.FS, name string) error

SetTouchStripImageFromFS draws an image from a filesystem to the touch strip display available on some Elgato Stream Deck models. The image is loaded from a filesystem, decoded and scaled as needed to fit the whole display.

func (*Device) SetTouchStripImageFromFSWithRectangle

func (d *Device) SetTouchStripImageFromFSWithRectangle(ffs fs.FS, name string, rect image.Rectangle) error

SetTouchStripImageFromFSWithRectangle draws an image from a filesystem to the touch strip display available on some Elgato Stream Deck models. The image is loaded from a filesystem, decoded and scaled as needed to fit the provided rectangle.

func (*Device) SetTouchStripImageFromFile

func (d *Device) SetTouchStripImageFromFile(name string) error

SetTouchStripImageFromFile draws an image from a file to the touch strip display available on some Elgato Stream Deck models. The image is loaded, decoded and scaled as needed to fit the whole display.

func (*Device) SetTouchStripImageFromFileWithRectangle

func (d *Device) SetTouchStripImageFromFileWithRectangle(name string, rect image.Rectangle) error

SetTouchStripImageFromFileWithRectangle draws an image from a file to the touch strip display available on some Elgato Stream Deck models. The image is loaded, decoded and scaled as needed to fit the provided rectangle.

func (*Device) SetTouchStripImageFromReadCloser

func (d *Device) SetTouchStripImageFromReadCloser(r io.ReadCloser) error

SetTouchStripImageFromReadCloser draws an image from an io.ReadCloser to the touch strip display available on some Elgato Stream Deck models. The ReadCloser is automatically closed after reading. The image is decoded and scaled as needed to fit the whole display.

func (*Device) SetTouchStripImageFromReadCloserWithRectangle

func (d *Device) SetTouchStripImageFromReadCloserWithRectangle(r io.ReadCloser, rect image.Rectangle) error

SetTouchStripImageFromReadCloserWithRectangle draws an image from an io.ReadCloser to the touch strip display available on some Elgato Stream Deck models. The ReadCloser is automatically closed after reading. The image is decoded and scaled as needed to fit the provided rectangle.

func (*Device) SetTouchStripImageFromReader

func (d *Device) SetTouchStripImageFromReader(r io.Reader) error

SetTouchStripImageFromReader draws an image from an io.Reader to the touch strip display available on some Elgato Stream Deck models. The image is decoded and scaled as needed to fit the whole display.

func (*Device) SetTouchStripImageFromReaderWithRectangle

func (d *Device) SetTouchStripImageFromReaderWithRectangle(r io.Reader, rect image.Rectangle) error

SetTouchStripImageFromReaderWithRectangle draws an image from an io.Reader to the touch strip display available on some Elgato Stream Deck models. The image is decoded and scaled as needed to fit the provided rectangle.

func (*Device) SetTouchStripImageWithRectangle

func (d *Device) SetTouchStripImageWithRectangle(img image.Image, rect image.Rectangle) error

SetTouchStripImageWithRectangle draws an image.Image to the touch strip display available on some Elgato Stream Deck models. The image is scaled as needed to fit the provided rectangle.

type Dial

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

Dial represents a rotative encoder with switch available on some Elgato Stream Deck devices.

func (*Dial) GetID

func (d *Dial) GetID() DialID

GetID returns the DialID identifier for this dial.

func (*Dial) String

func (d *Dial) String() string

String returns a string representation of the Dial.

func (*Dial) WaitForRelease

func (d *Dial) WaitForRelease() time.Duration

WaitForRelease blocks until the dial switch is released and returns the duration the dial switch was held closed. This method should be called from within a DialSwitchHandler.

type DialHandlerError

type DialHandlerError struct {
	DialID DialID
	Err    error
}

DialSwitchHandlerError represents an error returned by a dial switch handler including the dial identifier.

func (DialHandlerError) Error

func (b DialHandlerError) Error() string

Error returns a string representation of a dial handler error.

func (DialHandlerError) Unwrap

func (b DialHandlerError) Unwrap() error

Unwrap returns the underlying dial handler error.

type DialID

type DialID byte

DialID represents a physical Elgato Stream Deck device dial.

const (
	DIAL_1 DialID = iota + 1
	DIAL_2
	DIAL_3
	DIAL_4
)

Elgato Stream Deck dial identifiers. These constants represent the dials on the device depending on the supported models.

func (DialID) String

func (id DialID) String() string

String returns a string representation of the DialID.

type DialRotateHandler

type DialRotateHandler func(d *Device, di *Dial, delta int8) error

DialRotateHandler represents a callback function that is called when a dial is rotated. It receives the Device, the Dial instance and the rotation delta as parameters.

type DialSwitchHandler

type DialSwitchHandler func(d *Device, di *Dial) error

DialSwitchHandler represents a callback function that is called when a dial switch is activated. It receives the Device and Dial instances as parameters.

type Key

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

Key represents a physical key on the Elgato Stream Deck device.

func (*Key) GetID

func (k *Key) GetID() KeyID

GetID returns the KeyID identifier for this key.

func (*Key) String

func (k *Key) String() string

String returns a string representation of the Key.

func (*Key) WaitForRelease

func (k *Key) WaitForRelease() time.Duration

WaitForRelease blocks until the key is released and returns the duration the key was held down. This method should be called from within a KeyHandler.

type KeyHandler

type KeyHandler func(d *Device, k *Key) error

KeyHandler represents a callback function that is called when a key is pressed. It receives the Device and Key instances as parameters.

type KeyHandlerError

type KeyHandlerError struct {
	KeyID KeyID
	Err   error
}

KeyHandlerError represents an error returned by a key handler including the key identifier.

func (KeyHandlerError) Error

func (b KeyHandlerError) Error() string

Error returns a string representation of a key handler error.

func (KeyHandlerError) Unwrap

func (b KeyHandlerError) Unwrap() error

Unwrap returns the underlying key handler error.

type KeyID

type KeyID byte

KeyID represents a physical Elgato Stream Deck device key.

const (
	KEY_1 KeyID = iota + 1
	KEY_2
	KEY_3
	KEY_4
	KEY_5
	KEY_6
	KEY_7
	KEY_8
	KEY_9
	KEY_10
	KEY_11
	KEY_12
	KEY_13
	KEY_14
	KEY_15
)

Elgato Stream Deck key identifiers. These constants represent the physical keys on the device, depending on the supported models.

func (KeyID) String

func (id KeyID) String() string

String returns a string representation of the KeyID.

type TouchPoint

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

TouchPoint represents a touch-sensitive area on supported Elgato Stream Deck devices.

func (*TouchPoint) GetID

func (tp *TouchPoint) GetID() TouchPointID

GetID returns the TouchPointID identifier for this touch point.

func (*TouchPoint) String

func (tp *TouchPoint) String() string

String returns a string representation of the TouchPoint.

func (*TouchPoint) WaitForRelease

func (tp *TouchPoint) WaitForRelease() time.Duration

WaitForRelease blocks until the touch point is released and returns the duration the touch point was held down. This method should be called from within a TouchPointHandler.

type TouchPointHandler

type TouchPointHandler func(d *Device, tp *TouchPoint) error

TouchPointHandler represents a callback function that is called when a touch point is activated. It receives the Device and TouchPoint instances as parameters.

type TouchPointHandlerError

type TouchPointHandlerError struct {
	TouchPointID TouchPointID
	Err          error
}

TouchPointHandlerError represents an error returned by a touch point handler including the touch point identifier.

func (TouchPointHandlerError) Error

func (b TouchPointHandlerError) Error() string

Error returns a string representation of a touch point handler error.

func (TouchPointHandlerError) Unwrap

func (b TouchPointHandlerError) Unwrap() error

Unwrap returns the underlying touch point handler error.

type TouchPointID

type TouchPointID byte

TouchPointID represents a physical Elgato Stream Deck device touch point.

const (
	TOUCH_POINT_1 TouchPointID = iota + 1
	TOUCH_POINT_2
)

Elgato Stream Deck touch point identifiers. These constants represent the touch points on the device, depending on the supported models.

func (TouchPointID) String

func (id TouchPointID) String() string

String returns a string representation of the TouchPointID.

type TouchStripImageRectangleError

type TouchStripImageRectangleError struct {
	Rect image.Rectangle
}

TouchStripImageRectangleError represents an error when a provided image rectangle would not fit the touch strip display available on some Elgato Stream Deck devices.

func (TouchStripImageRectangleError) Error

Error returns a string representation of a touch strip image rectangle error.

type TouchStripSwipeHandler

type TouchStripSwipeHandler func(d *Device, origin image.Point, destination image.Point) error

TouchStripSwipeHandler represents a callback function that is called when a touch strip is swiped. It receives the Device instance, the origin point and the destination point as parameters.

type TouchStripSwipeHandlerError

type TouchStripSwipeHandlerError struct {
	Origin      image.Point
	Destination image.Point
	Err         error
}

TouchStripSwipeHandlerError represents an error returned by a touch strip swipe handler including the swipe origin and destination points.

func (TouchStripSwipeHandlerError) Error

Error returns a string representation of a touch strip swipe handler error.

func (TouchStripSwipeHandlerError) Unwrap

Unwrap returns the underlying touch strip swipe handler error.

type TouchStripTouchHandler

type TouchStripTouchHandler func(d *Device, t TouchStripTouchType, p image.Point) error

TouchStripTouchHandler represents a callback function that is called when a touch strip is touched. It receives the Device instance, the touch strip touch type and point as parameters.

type TouchStripTouchHandlerError

type TouchStripTouchHandlerError struct {
	Type  TouchStripTouchType
	Point image.Point
	Err   error
}

TouchStripTouchHandlerError represents an error returned by a touch strip touch handler including the touch type and touched point.

func (TouchStripTouchHandlerError) Error

Error returns a string representation of a touch strip touch handler error.

func (TouchStripTouchHandlerError) Unwrap

Unwrap returns the underlying touch strip touch handler error.

type TouchStripTouchType

type TouchStripTouchType byte

TouchStripTouchType represents a touch strip touch type

const (
	TOUCH_STRIP_TOUCH_TYPE_SHORT TouchStripTouchType = iota + 1
	TOUCH_STRIP_TOUCH_TYPE_LONG
)

Elgato Stream Deck touch strip touch types. These constants represent the duration while the touch strip was touched.

func (TouchStripTouchType) String

func (t TouchStripTouchType) String() string

String returns a string representation of the TouchStripTouchType.

Directories

Path Synopsis
examples
advanced command
basic command
device-info command
images command
multi-device command

Jump to

Keyboard shortcuts

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