Documentation
¶
Index ¶
- func CompareKeyConfigs(c1 KeyConfigV3, c2 KeyConfigV3) bool
- func CompareKeys(k1 KeyV3, k2 KeyV3) bool
- func DrawText(currentImage image.Image, text string, fontSize int, fontAlignment string) (image.Image, error)
- func FindXDoToolKeybindString(code int) string
- func ParseXDoToolKeybindString(keybind string) ([]int, error)
- func ResizeImage(img image.Image, keySize int) image.Image
- func ResizeImageWH(img image.Image, width int, height int) image.Image
- type Config
- type ConfigV1
- type ConfigV2
- type ConfigV3
- type Conn
- type Connection
- func (c *Connection) Close()
- func (c *Connection) CommitConfig() error
- func (c *Connection) GetConfig() (*ConfigV3, error)
- func (c *Connection) GetHandlerExample(serial string, keyConfig KeyConfigV3) (image.Image, error)
- func (c *Connection) GetInfo() ([]*StreamDeckInfoV1, error)
- func (c *Connection) GetKnobHandlerExample(serial string, knobConfig KnobConfigV3) (image.Image, error)
- func (c *Connection) GetModules() ([]*Module, error)
- func (c *Connection) GetObsFields() ([]*Field, error)
- func (c *Connection) PressButton(serial string, keyIndex int) error
- func (c *Connection) RegisterPageListener(cback func(string, int32)) error
- func (c *Connection) ReloadConfig() error
- func (c *Connection) SetConfig(config *ConfigV3) error
- func (c *Connection) SetPage(serial string, page int) error
- type Deck
- type DeckV2
- type DeckV3
- type DepracatedConfig
- type Field
- type Handler
- type IConn
- type IconHandler
- type InputEvent
- type InputEventType
- type Key
- type KeyConfigV3
- type KeyHandler
- type KeyV1
- type KeyV3
- type KnobActionV3
- type KnobConfigV3
- type KnobOrTouchHandler
- type KnobV3
- type LcdHandler
- type Module
- type ObsConnectionInfoV2
- type Page
- type PageV1
- type PageV3
- type StreamDeckInfo
- type StreamDeckInfoV1
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareKeyConfigs ¶
func CompareKeyConfigs(c1 KeyConfigV3, c2 KeyConfigV3) bool
func CompareKeys ¶
func FindXDoToolKeybindString ¶ added in v2.0.4
func ParseXDoToolKeybindString ¶ added in v2.0.4
Types ¶
type ConfigV2 ¶
type ConfigV2 struct {
Modules []string `json:"modules,omitempty"`
Decks []DeckV2 `json:"decks"`
ObsConnectionInfo ObsConnectionInfoV2 `json:"obs_connection_info,omitempty"`
}
type ConfigV3 ¶
type ConfigV3 struct {
Modules []string `json:"modules,omitempty"`
Decks []DeckV3 `json:"decks"`
ObsConnectionInfo ObsConnectionInfoV2 `json:"obs_connection_info,omitempty"`
}
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) AddMatchSignal ¶
func (c *Conn) AddMatchSignal(options ...dbus.MatchOption) error
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func Connect ¶
func Connect() (*Connection, error)
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) CommitConfig ¶
func (c *Connection) CommitConfig() error
func (*Connection) GetConfig ¶
func (c *Connection) GetConfig() (*ConfigV3, error)
func (*Connection) GetHandlerExample ¶
func (c *Connection) GetHandlerExample(serial string, keyConfig KeyConfigV3) (image.Image, error)
func (*Connection) GetInfo ¶
func (c *Connection) GetInfo() ([]*StreamDeckInfoV1, error)
func (*Connection) GetKnobHandlerExample ¶ added in v2.0.1
func (c *Connection) GetKnobHandlerExample(serial string, knobConfig KnobConfigV3) (image.Image, error)
func (*Connection) GetModules ¶
func (c *Connection) GetModules() ([]*Module, error)
func (*Connection) GetObsFields ¶
func (c *Connection) GetObsFields() ([]*Field, error)
func (*Connection) PressButton ¶
func (c *Connection) PressButton(serial string, keyIndex int) error
func (*Connection) RegisterPageListener ¶
func (c *Connection) RegisterPageListener(cback func(string, int32)) error
func (*Connection) ReloadConfig ¶
func (c *Connection) ReloadConfig() error
func (*Connection) SetConfig ¶
func (c *Connection) SetConfig(config *ConfigV3) error
type DepracatedConfig ¶
type IconHandler ¶
type IconHandler interface {
Handler
Start(key KeyConfigV3, info StreamDeckInfoV1, callback func(image image.Image))
IsRunning() bool
SetRunning(running bool)
Stop()
}
type InputEvent ¶
type InputEvent struct {
EventType InputEventType
RotateNotches uint8
}
type InputEventType ¶
type InputEventType uint8
const ( KNOB_CCW InputEventType = iota KNOB_CW KNOB_PRESS SCREEN_SHORT_TAP SCREEN_LONG_TAP )
type Key ¶
type Key struct {
Icon string `json:"icon,omitempty"`
SwitchPage int `json:"switch_page,omitempty"`
Text string `json:"text,omitempty"`
TextSize int `json:"text_size,omitempty"`
TextAlignment string `json:"text_alignment,omitempty"`
Keybind string `json:"keybind,omitempty"`
Command string `json:"command,omitempty"`
Brightness int `json:"brightness,omitempty"`
Url string `json:"url,omitempty"`
IconHandler string `json:"icon_handler,omitempty"`
KeyHandler string `json:"key_handler,omitempty"`
IconHandlerFields map[string]string `json:"icon_handler_fields,omitempty"`
KeyHandlerFields map[string]string `json:"key_handler_fields,omitempty"`
Buff image.Image `json:"-"`
IconHandlerStruct IconHandler `json:"-"`
KeyHandlerStruct KeyHandler `json:"-"`
}
type KeyConfigV3 ¶
type KeyConfigV3 struct {
Icon string `json:"icon,omitempty"`
SwitchPage int `json:"switch_page,omitempty"`
Text string `json:"text,omitempty"`
TextSize int `json:"text_size,omitempty"`
TextAlignment string `json:"text_alignment,omitempty"`
Keybind string `json:"keybind,omitempty"`
Command string `json:"command,omitempty"`
Brightness int `json:"brightness,omitempty"`
Url string `json:"url,omitempty"`
KeyHold int `json:"key_hold,omitempty"`
ObsCommand string `json:"obs_command,omitempty"`
ObsCommandParams map[string]string `json:"obs_command_params,omitempty"`
IconHandler string `json:"icon_handler,omitempty"`
KeyHandler string `json:"key_handler,omitempty"`
IconHandlerFields map[string]any `json:"icon_handler_fields,omitempty"`
KeyHandlerFields map[string]any `json:"key_handler_fields,omitempty"`
Buff image.Image `json:"-"`
IconHandlerStruct IconHandler `json:"-"`
KeyHandlerStruct KeyHandler `json:"-"`
}
type KeyHandler ¶
type KeyHandler interface {
Handler
Key(key KeyConfigV3, info StreamDeckInfoV1)
}
type KeyV1 ¶
type KeyV1 struct {
Icon string `json:"icon,omitempty"`
SwitchPage int `json:"switch_page,omitempty"`
Text string `json:"text,omitempty"`
TextSize int `json:"text_size,omitempty"`
TextAlignment string `json:"text_alignment,omitempty"`
Keybind string `json:"keybind,omitempty"`
Command string `json:"command,omitempty"`
Brightness int `json:"brightness,omitempty"`
Url string `json:"url,omitempty"`
ObsCommand string `json:"obs_command,omitempty"`
ObsCommandParams map[string]string `json:"obs_command_params,omitempty"`
IconHandler string `json:"icon_handler,omitempty"`
KeyHandler string `json:"key_handler,omitempty"`
IconHandlerFields map[string]any `json:"icon_handler_fields,omitempty"`
KeyHandlerFields map[string]any `json:"key_handler_fields,omitempty"`
Buff image.Image `json:"-"`
IconHandlerStruct IconHandler `json:"-"`
KeyHandlerStruct KeyHandler `json:"-"`
}
type KeyV3 ¶
type KeyV3 struct {
Application map[string]*KeyConfigV3 `json:"application,omitempty"`
ActiveBuff image.Image `json:"-"`
ActiveIconHandlerStruct *IconHandler `json:"-"`
ActiveKeyHandlerStruct *KeyHandler `json:"-"`
ActiveApplication string `json:"-"`
}
type KnobActionV3 ¶
type KnobActionV3 struct {
SwitchPage int `json:"switch_page,omitempty"`
Keybind string `json:"keybind,omitempty"`
Command string `json:"command,omitempty"`
Brightness int `json:"brightness,omitempty"`
Url string `json:"url,omitempty"`
ObsCommand string `json:"obs_command,omitempty"`
ObsCommandParams map[string]string `json:"obs_command_params,omitempty"`
}
type KnobConfigV3 ¶
type KnobConfigV3 struct {
Icon string `json:"icon,omitempty"`
Text string `json:"text,omitempty"`
TextSize int `json:"text_size,omitempty"`
TextAlignment string `json:"text_alignment,omitempty"`
LcdHandler string `json:"lcd_handler,omitempty"`
KnobOrTouchHandler string `json:"knob_or_touch_handler,omitempty"`
Buff image.Image `json:"-"`
LcdHandlerStruct LcdHandler `json:"-"`
KnobOrTouchHandlerStruct KnobOrTouchHandler `json:"-"`
LcdHandlerFields map[string]any `json:"lcd_handler_fields,omitempty"`
KnobOrTouchHandlerFields map[string]any `json:"knob_or_touch_handler_fields,omitempty"`
KnobPressAction KnobActionV3 `json:"knob_press_action,omitempty"`
KnobTurnUpAction KnobActionV3 `json:"knob_turn_up_action,omitempty"`
KnobTurnDownAction KnobActionV3 `json:"knob_turn_down_action,omitempty"`
}
type KnobOrTouchHandler ¶
type KnobOrTouchHandler interface {
Handler
Input(key KnobConfigV3, info StreamDeckInfoV1, event InputEvent)
}
type KnobV3 ¶
type KnobV3 struct {
Application map[string]*KnobConfigV3 `json:"application,omitempty"`
ActiveBuff image.Image `json:"-"`
ActiveApplication string `json:"-"`
}
type LcdHandler ¶
type LcdHandler interface {
Handler
Start(key KnobConfigV3, info StreamDeckInfoV1, callback func(image image.Image))
IsRunning() bool
SetRunning(running bool)
Stop()
}
type Module ¶
type Module struct {
Name string `json:"name,omitempty"`
NewIcon func() IconHandler `json:"-"`
NewKey func() KeyHandler `json:"-"`
NewLcd func() LcdHandler `json:"-"`
NewKnobOrTouch func() KnobOrTouchHandler `json:"-"`
IconFields []Field `json:"icon_fields,omitempty"`
KeyFields []Field `json:"key_fields,omitempty"`
LcdFields []Field `json:"lcd_fields,omitempty"`
KnobOrTouchFields []Field `json:"knob_or_touch_fields,omitempty"`
LinkedFields []Field `json:"linked_fields,omitempty"`
IsIcon bool `json:"is_icon,omitempty"`
IsKey bool `json:"is_key,omitempty"`
IsLcd bool `json:"is_lcd,omitempty"`
IsKnob bool `json:"is_knob,omitempty"`
IsLinkedHandlers bool `json:"is_linked_handlers,omitempty"`
Linked bool `json:"linked,omitempty"`
}
type ObsConnectionInfoV2 ¶
type StreamDeckInfo ¶
type StreamDeckInfoV1 ¶
type StreamDeckInfoV1 struct {
Cols int `json:"cols,omitempty"`
Rows int `json:"rows,omitempty"`
IconSize int `json:"icon_size,omitempty"`
Page int `json:"page"`
Serial string `json:"serial,omitempty"`
Name string `json:"name,omitempty"`
Connected bool `json:"connected"`
LastConnected time.Time `json:"last_connected,omitempty"`
LastDisconnected time.Time `json:"last_disconnected,omitempty"`
LcdWidth int `json:"lcd_width,omitempty"`
LcdHeight int `json:"lcd_height,omitempty"`
LcdCols int `json:"lcd_cols,omitempty"`
KnobCols int `json:"knob_cols,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.