Documentation
¶
Index ¶
- Variables
- func Serials(pid PID) ([]string, error)
- type Deck
- func (d *Deck) Bounds() (image.Rectangle, error)
- func (d *Deck) Close() error
- func (d *Deck) Firmware() (string, error)
- func (d *Deck) Key(row, col int) int
- func (d *Deck) KeyStates() ([]bool, error)
- func (d *Deck) Layout() (rows, cols int)
- func (d *Deck) Len() int
- func (d *Deck) PID() PID
- func (d *Deck) RawImage(img image.Image) (*RawImage, error)
- func (d *Deck) Reconnect(ctx context.Context, delay time.Duration) error
- func (d *Deck) Reset() error
- func (d *Deck) ResetKeyStream() error
- func (d *Deck) Serial() (string, error)
- func (d *Deck) SetBrightness(percent int) error
- func (d *Deck) SetImage(row, col int, img image.Image) error
- type PID
- type RawImage
Constants ¶
This section is empty.
Variables ¶
var ErrNotConnected = errors.New("device not connected")
ErrNotConnected indicates that the Deck is no longer connected.
Functions ¶
Types ¶
type Deck ¶
type Deck struct {
// contains filtered or unexported fields
}
Deck is a Stream Deck device.
func NewDeck ¶
NewDeck returns the first a Deck using the HID corresponding the the given Stream Deck pid and serial. If serial is empty the first matching pid is used.
func (*Deck) Bounds ¶
Bounds returns the image bounds for buttons on the device. If the device is not visual an error is returned.
func (*Deck) Key ¶
Key returns the key number corresponding to the given row and column. It panics if row or col are out of bounds.
func (*Deck) KeyStates ¶
KeyStates returns a slice of booleans indicating which buttons are pressed. The length of the returned slice is given by the Len method.
func (*Deck) RawImage ¶
RawImage returns an image.Image has had the internal image representation pre-computed after resizing to fit the Deck's button size. The original image is retained in the returned image.
func (*Deck) Reconnect ¶
Reconnect attempts to reconnect to the receiver's device each delay until successful or the context is cancelled. Reconnect returns the last error if ctx is cancelled.
func (*Deck) Reset ¶
Resets the Stream Deck, clearing all button images and showing the standby image.
func (*Deck) ResetKeyStream ¶
ResetKeyStream sends a blank key report to the Stream Deck, resetting the key image streamer in the device. This prevents previously started partial writes from corrupting images sent later.
func (*Deck) SetBrightness ¶
SetBrightness sets the global screen brightness of the Stream Deck, across all the device's buttons.