Documentation
¶
Index ¶
- Constants
- func PlusInputHandler(d *Device, cback func(event InputEvent))
- type Device
- func (d Device) Clear() error
- func (d *Device) Close() error
- func (d *Device) Fade(start uint8, end uint8, duration time.Duration) error
- func (d Device) FirmwareVersion() (string, error)
- func (d *Device) HandleInput(cback func(event InputEvent))
- func (d *Device) Open() error
- func (d Device) Reset() error
- func (d *Device) SetBrightness(percent uint8) error
- func (d Device) SetImage(index uint8, img image.Image) error
- func (d Device) SetLcdImage(index int, img image.Image) error
- func (d *Device) SetSleepFadeDuration(t time.Duration)
- type HidDevice
- func (h *HidDevice) Close() error
- func (h *HidDevice) GetFeatureReport(payload []byte) (int, error)
- func (h *HidDevice) GetManufacturer() (string, error)
- func (h *HidDevice) GetProduct() (string, error)
- func (h *HidDevice) GetSerial() (string, error)
- func (h *HidDevice) Open() (*hid.Device, error)
- func (h *HidDevice) Read(payload []byte) (int, error)
- func (h *HidDevice) SendFeatureReport(payload []byte) (int, error)
- func (h *HidDevice) Write(payload []byte) (int, error)
- type IHidDevice
- type InputEvent
- type InputEventType
- type Key
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 PID_STREAMDECK_PEDAL = 0x0086 PID_STREAMDECK_PLUS = 0x0084 )
Stream Deck Vendor & Product IDs.
Variables ¶
This section is empty.
Functions ¶
func PlusInputHandler ¶
func PlusInputHandler(d *Device, cback func(event InputEvent))
Types ¶
type Device ¶
type Device struct {
ID string
Serial string
Columns uint8
Rows uint8
LcdColumns uint8
Keys uint8
Knobs uint8
Pixels uint
LcdWidth uint
LcdHeight uint
DPI uint
Padding uint
KeyStateOffset int
TranslateKeyIndex func(index, columns uint8) uint8
KeyState []byte
Device IHidDevice
HasScreen bool
HasLCD bool
HasKnobs bool
LCDBuffer image.Image
WriteSem *semaphore.Weighted
InputHandler func(device *Device, cback func(event InputEvent))
// contains filtered or unexported fields
}
Device represents a single Stream Deck device.
func GetDevInfo ¶
func GetDevInfo(d hid.DeviceInfo) Device
func (Device) FirmwareVersion ¶
FirmwareVersion returns the firmware version of the device.
func (*Device) HandleInput ¶
func (d *Device) HandleInput(cback func(event InputEvent))
func (*Device) Open ¶
Open the device for input/output. This must be called before trying to communicate with the device.
func (*Device) SetBrightness ¶
SetBrightness sets the background lighting brightness from 0 to 100 percent.
func (Device) SetImage ¶
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 ¶
SetSleepFadeDuration sets the duration of the fading animation when the device is put to sleep or wakes up.
type HidDevice ¶
type HidDevice struct {
Device *hid.Device
WriteSem *semaphore.Weighted
// contains filtered or unexported fields
}
func (*HidDevice) GetFeatureReport ¶
func (*HidDevice) GetManufacturer ¶
func (*HidDevice) GetProduct ¶
func (*HidDevice) SendFeatureReport ¶
type IHidDevice ¶
type IHidDevice interface {
Open() (*hid.Device, error)
Close() error
GetFeatureReport(payload []byte) (int, error)
SendFeatureReport(payload []byte) (int, error)
Write(payload []byte) (int, error)
Read(payload []byte) (int, error)
GetManufacturer() (string, error)
GetProduct() (string, error)
GetSerial() (string, error)
}
type InputEvent ¶
type InputEventType ¶
type InputEventType uint8
const ( KNOB_CCW InputEventType = iota KNOB_CW KNOB_PRESS SCREEN_SHORT_TAP SCREEN_LONG_TAP SCREEN_SWIPE KEY_PRESS KEY_RELEASE )
Click to show internal directories.
Click to hide internal directories.