streamdeck

package
v1.0.44 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VID_ELGATO              = 0x0fd9
	PID_STREAMDECK          = 0x0060
	PID_STREAMDECK_V2       = 0x006d
	PID_STREAMDECK_MK2      = 0x0080
	PID_STREAMDECK_MINI     = 0x0063
	PID_STREAMDECK_MINI_MK2 = 0x0090
	PID_STREAMDECK_XL       = 0x006c
)

Stream Deck Vendor & Product IDs.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	ID     string
	Serial string

	Columns uint8
	Rows    uint8
	Keys    uint8
	Pixels  uint
	DPI     uint
	Padding uint
	// contains filtered or unexported fields
}

Device represents a single Stream Deck device.

func Devices

func Devices() ([]Device, error)

Devices returns all attached Stream Decks.

func (Device) Asleep

func (d Device) Asleep() bool

Asleep returns true if the device is asleep.

func (Device) Clear

func (d Device) Clear() error

Clears the Stream Deck, setting a black image on all buttons.

func (*Device) Close

func (d *Device) Close() error

Close the connection with the device.

func (*Device) Fade

func (d *Device) Fade(start uint8, end uint8, duration time.Duration) error

Fade fades the brightness in or out.

func (Device) FirmwareVersion

func (d Device) FirmwareVersion() (string, error)

FirmwareVersion returns the firmware version of the device.

func (*Device) Open

func (d *Device) Open() error

Open the device for input/output. This must be called before trying to communicate with the device.

func (*Device) ReadKeys

func (d *Device) ReadKeys() (chan Key, error)

ReadKeys returns a channel, which it will use to emit key presses/releases.

func (Device) Reset

func (d Device) Reset() error

Resets the Stream Deck, clears all button images and shows the standby image.

func (*Device) SetBrightness

func (d *Device) SetBrightness(percent uint8) error

SetBrightness sets the background lighting brightness from 0 to 100 percent.

func (Device) SetImage

func (d Device) SetImage(index uint8, img image.Image) error

SetImage sets the image of a button on the Stream Deck. The provided image needs to be in the correct resolution for the device. The index starts with 0 being the top-left button.

func (*Device) SetSleepFadeDuration

func (d *Device) SetSleepFadeDuration(t time.Duration)

SetSleepFadeDuration sets the duration of the fading animation when the device is put to sleep or wakes up.

func (*Device) SetSleepTimeout

func (d *Device) SetSleepTimeout(t time.Duration)

SetSleepTimeout sets the time after which the device will sleep if no key events are received.

func (*Device) Sleep

func (d *Device) Sleep() error

Sleep puts the device asleep, waiting for a key event to wake it up.

func (*Device) Wake

func (d *Device) Wake() error

Wake wakes the device from sleep.

type Key

type Key struct {
	Index   uint8
	Pressed bool
}

Key holds the current status of a key on the device.

Jump to

Keyboard shortcuts

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