Documentation
¶
Index ¶
- Variables
- func Image(i image.Image) (string, error)
- type Action
- func (a *Action[S]) Client() *Client
- func (a *Action[S]) Contexts() []context.Context
- func (a *Action[S]) GetResources(ctx context.Context) (map[string]string, error)
- func (a *Action[S]) GetSettings(ctx context.Context) (S, error)
- func (a *Action[S]) OnDialDown(h func(context.Context, DialDownEvent[S]) error)
- func (a *Action[S]) OnDialRotate(h func(context.Context, DialRotateEvent[S]) error)
- func (a *Action[S]) OnDialUp(h func(context.Context, DialUpEvent[S]) error)
- func (a *Action[S]) OnDidReceiveResources(h func(context.Context, DidReceiveResourcesEvent[S]) error)
- func (a *Action[S]) OnDidReceiveSettings(h func(context.Context, DidReceiveSettingsEvent[S]) error)
- func (a *Action[S]) OnKeyDown(h func(context.Context, KeyDownEvent[S]) error)
- func (a *Action[S]) OnKeyUp(h func(context.Context, KeyUpEvent[S]) error)
- func (a *Action[S]) OnPropertyInspectorDidAppear(h func(context.Context, PropertyInspectorDidAppearEvent[S]) error)
- func (a *Action[S]) OnPropertyInspectorDidDisappear(h func(context.Context, PropertyInspectorDidDisappearEvent[S]) error)
- func (a *Action[S]) OnPropertyInspectorMessage[M any](h func(context.Context, M) error)
- func (a *Action[S]) OnTitleParametersDidChange(h func(context.Context, TitleParametersDidChangeEvent[S]) error)
- func (a *Action[S]) OnTouchTap(h func(context.Context, TouchTapEvent[S]) error)
- func (a *Action[S]) OnWillAppear(h func(context.Context, WillAppearEvent[S]) error)
- func (a *Action[S]) OnWillDisappear(h func(context.Context, WillDisappearEvent[S]) error)
- func (a *Action[S]) RegisterHandler(event EventName, handler func(context.Context, Event) error)
- func (a *Action[S]) SendToPropertyInspector[M any](ctx context.Context, msg M) error
- func (a *Action[S]) SetFeedback(ctx context.Context, payload Feedback) error
- func (a *Action[S]) SetFeedbackLayout(ctx context.Context, layout string) error
- func (a *Action[S]) SetImage(ctx context.Context, base64image string, target Target, state ...int) error
- func (a *Action[S]) SetResources(ctx context.Context, resources map[string]string) error
- func (a *Action[S]) SetSettings(ctx context.Context, settings S) error
- func (a *Action[S]) SetState(ctx context.Context, state int) error
- func (a *Action[S]) SetTitle(ctx context.Context, title string, target Target, state ...int) error
- func (a *Action[S]) ShowAlert(ctx context.Context) error
- func (a *Action[S]) ShowOk(ctx context.Context) error
- func (a *Action[S]) UUID() string
- type ActionEvent
- type ActionInfo
- type ActionInfoPayload
- type Application
- type ApplicationDidLaunchPayload
- type ApplicationDidTerminatePayload
- type BarFeedback
- type Client
- func (c *Client) Close() error
- func (c *Client) GetGlobalSettings[G any](ctx context.Context) (G, error)
- func (c *Client) GetSecrets[G any](ctx context.Context) (G, error)
- func (c *Client) IsConnected() bool
- func (c *Client) LogMessage(ctx context.Context, message string) error
- func (c *Client) On(event EventName, handler EventHandler)
- func (c *Client) OnApplicationDidLaunch(h func(context.Context, ApplicationDidLaunchPayload) error)
- func (c *Client) OnApplicationDidTerminate(h func(context.Context, ApplicationDidTerminatePayload) error)
- func (c *Client) OnDeviceDidChange(h func(context.Context, DeviceEvent) error)
- func (c *Client) OnDeviceDidConnect(h func(context.Context, DeviceEvent) error)
- func (c *Client) OnDeviceDidDisconnect(h func(context.Context, DeviceEvent) error)
- func (c *Client) OnDidReceiveDeepLink(h func(context.Context, DidReceiveDeepLinkPayload) error)
- func (c *Client) OnDidReceiveGlobalSettings[G any](h func(context.Context, G) error)
- func (c *Client) OnDidReceiveSecrets[G any](h func(context.Context, G) error)
- func (c *Client) OnSystemDidWakeUp(h func(context.Context) error)
- func (c *Client) OpenURL(ctx context.Context, u url.URL) error
- func (c *Client) Params() RegistrationParams
- func (c *Client) RegisterNoActionHandler(event EventName, handler EventHandler)
- func (c *Client) Run(ctx context.Context) error
- func (c *Client) SetFeedback(ctx context.Context, payload Feedback) error
- func (c *Client) SetFeedbackLayout(ctx context.Context, layout string) error
- func (c *Client) SetGlobalSettings[G any](ctx context.Context, settings G) error
- func (c *Client) SetImage(ctx context.Context, base64image string, target Target, state ...int) error
- func (c *Client) SetState(ctx context.Context, state int) error
- func (c *Client) SetTitle(ctx context.Context, title string, target Target, state ...int) error
- func (c *Client) SetTriggerDescription(ctx context.Context, payload SetTriggerDescriptionPayload) error
- func (c *Client) ShowAlert(ctx context.Context) error
- func (c *Client) ShowOk(ctx context.Context) error
- func (c *Client) SwitchToProfile(ctx context.Context, profile string, page ...int) error
- func (c *Client) UUID() string
- type ClientOption
- type Colors
- type Controller
- type Coordinates
- type Device
- type DeviceEvent
- type DeviceInfo
- type DeviceSize
- type DeviceType
- type DialDownEvent
- type DialDownPayload
- type DialRotateEvent
- type DialRotatePayload
- type DialUpEvent
- type DialUpPayload
- type DidReceiveDeepLinkPayload
- type DidReceiveGlobalSettingsPayload
- type DidReceiveResourcesEvent
- type DidReceiveResourcesPayload
- type DidReceiveSecretsPayload
- type DidReceiveSettingsEvent
- type DidReceiveSettingsPayload
- type Event
- type EventHandler
- type EventName
- type Feedback
- type FeedbackFont
- type FeedbackNumber
- type FeedbackRange
- type FeedbackString
- type FeedbackValue
- type GaugeBarFeedback
- type Info
- type KeyDownEvent
- type KeyDownPayload
- type KeyUpEvent
- type KeyUpPayload
- type Language
- type LogMessagePayload
- type OpenURLPayload
- type PixmapFeedback
- type Platform
- type Plugin
- type PropertyInspectorDidAppearEvent
- type PropertyInspectorDidAppearPayload
- type PropertyInspectorDidDisappearEvent
- type PropertyInspectorDidDisappearPayload
- type RegistrationParams
- type SetFeedbackLayoutPayload
- type SetImagePayload
- type SetStatePayload
- type SetTitlePayload
- type SetTriggerDescriptionPayload
- type Size
- type SwitchProfilePayload
- type Target
- type TextAlignment
- type TextFeedback
- type TextOverflow
- type TitleParameters
- type TitleParametersDidChangeEvent
- type TitleParametersDidChangePayload
- type TouchTapEvent
- type TouchTapPayload
- type WillAppearEvent
- type WillAppearPayload
- type WillDisappearEvent
- type WillDisappearPayload
Constants ¶
This section is empty.
Variables ¶
var ( ErrMissingPortFlag = errors.New("missing -port flag") ErrMissingPluginUUIDFlag = errors.New("missing -pluginUUID flag") ErrMissingRegisterEventFlag = errors.New("missing -registerEvent flag") ErrMissingInfoFlag = errors.New("missing -info flag") ErrConnectionFailed = errors.New("connection failed") ErrWriteFailed = errors.New("write failed") ErrReadFailed = errors.New("read failed") ErrInvalidMessage = errors.New("invalid message") ErrNotConnected = errors.New("client is not connected") )
Stream Deck plugin errors.
Functions ¶
Types ¶
type Action ¶
type Action[S any] struct { // contains filtered or unexported fields }
Action is a typed handle for a plugin action UUID and its settings type S.
func NewAction ¶
NewAction registers or returns the action for uuid. It panics if uuid is already registered with a different settings type.
func (*Action[S]) GetResources ¶
GetResources requests action resources and waits for the matching response.
func (*Action[S]) GetSettings ¶
GetSettings requests action-instance settings and waits for the matching response.
func (*Action[S]) OnDialDown ¶
OnDialDown registers a dialDown handler.
func (*Action[S]) OnDialRotate ¶
OnDialRotate registers a dialRotate handler.
func (*Action[S]) OnDidReceiveResources ¶
func (a *Action[S]) OnDidReceiveResources(h func(context.Context, DidReceiveResourcesEvent[S]) error)
OnDidReceiveResources registers a didReceiveResources handler for unsolicited updates.
func (*Action[S]) OnDidReceiveSettings ¶
OnDidReceiveSettings registers a didReceiveSettings handler for unsolicited updates.
func (*Action[S]) OnPropertyInspectorDidAppear ¶
func (a *Action[S]) OnPropertyInspectorDidAppear(h func(context.Context, PropertyInspectorDidAppearEvent[S]) error)
OnPropertyInspectorDidAppear registers a propertyInspectorDidAppear handler.
func (*Action[S]) OnPropertyInspectorDidDisappear ¶
func (a *Action[S]) OnPropertyInspectorDidDisappear(h func(context.Context, PropertyInspectorDidDisappearEvent[S]) error)
OnPropertyInspectorDidDisappear registers a propertyInspectorDidDisappear handler.
func (*Action[S]) OnPropertyInspectorMessage ¶
OnPropertyInspectorMessage registers a sendToPlugin handler with a message type independent of S.
func (*Action[S]) OnTitleParametersDidChange ¶
func (a *Action[S]) OnTitleParametersDidChange(h func(context.Context, TitleParametersDidChangeEvent[S]) error)
OnTitleParametersDidChange registers a titleParametersDidChange handler.
func (*Action[S]) OnTouchTap ¶
OnTouchTap registers a touchTap handler.
func (*Action[S]) OnWillAppear ¶
func (a *Action[S]) OnWillAppear(h func(context.Context, WillAppearEvent[S]) error)
OnWillAppear registers a willAppear handler.
func (*Action[S]) OnWillDisappear ¶
OnWillDisappear registers a willDisappear handler.
func (*Action[S]) RegisterHandler ¶
RegisterHandler appends a raw handler for event. The handler list is copied on write so dispatch never holds the lock.
func (*Action[S]) SendToPropertyInspector ¶
SendToPropertyInspector sends a typed message to the property inspector.
func (*Action[S]) SetFeedback ¶
SetFeedback updates Stream Deck + layout items for the instance identified by ctx.
func (*Action[S]) SetFeedbackLayout ¶
SetFeedbackLayout sets the layout for the instance identified by ctx.
func (*Action[S]) SetImage ¶
func (a *Action[S]) SetImage(ctx context.Context, base64image string, target Target, state ...int) error
SetImage changes the image of the action instance identified by ctx.
func (*Action[S]) SetResources ¶
SetResources stores files associated with the action instance.
func (*Action[S]) SetSettings ¶
SetSettings persists action-instance settings.
type ActionEvent ¶
ActionEvent is a typed event bound to an action instance.
type ActionInfo ¶
type ActionInfo[SettingsT any] struct { Action string `json:"action"` Context string `json:"context"` Device string `json:"device"` Payload ActionInfoPayload[SettingsT] `json:"payload"` }
ActionInfo describes the selected action when a property inspector starts.
type ActionInfoPayload ¶
type ActionInfoPayload[SettingsT any] struct { Coordinates Coordinates `json:"coordinates,omitempty"` Settings SettingsT `json:"settings,omitempty"` }
ActionInfoPayload is the payload of a property inspector actionInfo object.
type Application ¶
type Application struct {
Font string `json:"font"`
Language Language `json:"language"`
Platform Platform `json:"platform"`
PlatformVersion string `json:"platformVersion"`
Version string `json:"version"`
}
Application describes the Stream Deck application.
type ApplicationDidLaunchPayload ¶
type ApplicationDidLaunchPayload struct {
Application string `json:"application,omitempty"`
}
ApplicationDidLaunchPayload names a monitored application that launched.
type ApplicationDidTerminatePayload ¶
type ApplicationDidTerminatePayload struct {
Application string `json:"application,omitempty"`
}
ApplicationDidTerminatePayload names a monitored application that exited.
type BarFeedback ¶
type BarFeedback struct {
Background string `json:"background,omitempty"`
BarBgC string `json:"bar_bg_c,omitempty"`
BarBorderC string `json:"bar_border_c,omitempty"`
BarFillC string `json:"bar_fill_c,omitempty"`
BorderW *int `json:"border_w,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Opacity *float64 `json:"opacity,omitempty"`
Range *FeedbackRange `json:"range,omitempty"`
Subtype *int `json:"subtype,omitempty"`
Value *float64 `json:"value,omitempty"`
ZOrder *int `json:"zOrder,omitempty"`
}
BarFeedback is a bar layout item.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client communicates with the Stream Deck application over WebSocket.
func NewClient ¶
func NewClient(_ context.Context, params RegistrationParams, opts ...ClientOption) *Client
NewClient builds a client from Stream Deck registration parameters.
func (*Client) GetGlobalSettings ¶
GetGlobalSettings requests plugin-wide settings and waits for the matching response.
func (*Client) GetSecrets ¶
GetSecrets requests plugin secrets and waits for the matching response.
func (*Client) IsConnected ¶
IsConnected reports whether the WebSocket is open.
func (*Client) LogMessage ¶
LogMessage writes a debug line to the Stream Deck log file.
func (*Client) On ¶
func (c *Client) On(event EventName, handler EventHandler)
On registers a handler for events that are not bound to an action UUID.
func (*Client) OnApplicationDidLaunch ¶
func (c *Client) OnApplicationDidLaunch(h func(context.Context, ApplicationDidLaunchPayload) error)
OnApplicationDidLaunch registers a handler for applicationDidLaunch.
func (*Client) OnApplicationDidTerminate ¶
func (c *Client) OnApplicationDidTerminate(h func(context.Context, ApplicationDidTerminatePayload) error)
OnApplicationDidTerminate registers a handler for applicationDidTerminate.
func (*Client) OnDeviceDidChange ¶
func (c *Client) OnDeviceDidChange(h func(context.Context, DeviceEvent) error)
OnDeviceDidChange registers a handler for deviceDidChange.
func (*Client) OnDeviceDidConnect ¶
func (c *Client) OnDeviceDidConnect(h func(context.Context, DeviceEvent) error)
OnDeviceDidConnect registers a handler for deviceDidConnect.
func (*Client) OnDeviceDidDisconnect ¶
func (c *Client) OnDeviceDidDisconnect(h func(context.Context, DeviceEvent) error)
OnDeviceDidDisconnect registers a handler for deviceDidDisconnect.
func (*Client) OnDidReceiveDeepLink ¶
func (c *Client) OnDidReceiveDeepLink(h func(context.Context, DidReceiveDeepLinkPayload) error)
OnDidReceiveDeepLink registers a handler for didReceiveDeepLink.
func (*Client) OnDidReceiveGlobalSettings ¶
OnDidReceiveGlobalSettings registers a handler for unsolicited global settings updates.
func (*Client) OnDidReceiveSecrets ¶
OnDidReceiveSecrets registers a handler for didReceiveSecrets.
func (*Client) OnSystemDidWakeUp ¶
OnSystemDidWakeUp registers a handler for systemDidWakeUp.
func (*Client) Params ¶
func (c *Client) Params() RegistrationParams
Params returns the registration parameters.
func (*Client) RegisterNoActionHandler ¶
func (c *Client) RegisterNoActionHandler(event EventName, handler EventHandler)
RegisterNoActionHandler is an alias of On for events such as applicationDidLaunch.
func (*Client) Run ¶
Run connects to Stream Deck, registers, and dispatches events until the connection ends or ctx is cancelled. Stream Deck sends os.Interrupt (Ctrl+C) when the app shuts down or the plugin is uninstalled; Run listens for that in addition to ctx.
func (*Client) SetFeedback ¶
SetFeedback updates Stream Deck + layout items.
func (*Client) SetFeedbackLayout ¶
SetFeedbackLayout sets the layout associated with an action instance.
func (*Client) SetGlobalSettings ¶
SetGlobalSettings saves plugin-wide settings.
func (*Client) SetImage ¶
func (c *Client) SetImage(ctx context.Context, base64image string, target Target, state ...int) error
SetImage changes the image of an action instance identified by ctx.
func (*Client) SetTriggerDescription ¶
func (c *Client) SetTriggerDescription(ctx context.Context, payload SetTriggerDescriptionPayload) error
SetTriggerDescription sets encoder trigger descriptions.
func (*Client) SwitchToProfile ¶
SwitchToProfile switches to a plugin-distributed profile.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption configures a Client.
func WithErrorHandler ¶
func WithErrorHandler(h func(context.Context, error)) ClientOption
WithErrorHandler is called when an event handler returns an error.
func WithLogger ¶
func WithLogger(logger *slog.Logger) ClientOption
WithLogger sets the client logger. The default logger discards output.
func WithQueueSize ¶
func WithQueueSize(n int) ClientOption
WithQueueSize sets the initial per-context event buffer capacity. The mailbox grows if a handler is slower than incoming events (for example dialRotate bursts). Zero or negative uses the default.
func WithWebSocketURL ¶
func WithWebSocketURL(u string) ClientOption
WithWebSocketURL overrides the Stream Deck WebSocket URL. Intended for tests.
type Colors ¶
type Colors struct {
ButtonPressedBackgroundColor string `json:"buttonPressedBackgroundColor"`
ButtonPressedBorderColor string `json:"buttonPressedBorderColor"`
ButtonPressedTextColor string `json:"buttonPressedTextColor"`
ButtonMouseOverBackgroundColor string `json:"buttonMouseOverBackgroundColor"`
HighlightColor string `json:"highlightColor"`
}
Colors are the Stream Deck application's preferred colors.
type Controller ¶
type Controller string
Controller identifies the input type of an action instance.
const ( ControllerKeypad Controller = "Keypad" ControllerEncoder Controller = "Encoder" ControllerNeo Controller = "Neo" )
type Coordinates ¶
Coordinates locate an action on a device grid.
type Device ¶
type Device struct {
ID string `json:"id"`
Name string `json:"name"`
Size Size `json:"size"`
Type DeviceType `json:"type"`
}
Device is a device listed in registration info.
type DeviceEvent ¶
type DeviceEvent struct {
Device string
DeviceInfo DeviceInfo
}
DeviceEvent is a deviceDidConnect, deviceDidDisconnect, or deviceDidChange message.
type DeviceInfo ¶
type DeviceInfo struct {
Name string `json:"name,omitempty"`
Type DeviceType `json:"type,omitempty"`
Size DeviceSize `json:"size,omitempty"`
}
DeviceInfo describes a Stream Deck device.
type DeviceSize ¶
DeviceSize is the key grid size of a device, excluding dials and touchscreens.
type DeviceType ¶
type DeviceType int
DeviceType is a Stream Deck hardware type. See https://github.com/elgatosf/schemas/blob/main/src/streamdeck/plugins/device-type.ts
const ( StreamDeck DeviceType = 0 StreamDeckMini DeviceType = 1 StreamDeckXL DeviceType = 2 StreamDeckMobile DeviceType = 3 CorsairGKeys DeviceType = 4 StreamDeckPedal DeviceType = 5 CorsairVoyager DeviceType = 6 StreamDeckPlus DeviceType = 7 SCUFController DeviceType = 8 StreamDeckNeo DeviceType = 9 StreamDeckStudio DeviceType = 10 VirtualStreamDeck DeviceType = 11 Galleon100SD DeviceType = 12 StreamDeckPlusXL DeviceType = 13 )
type DialDownEvent ¶
type DialDownEvent[S any] = ActionEvent[DialDownPayload[S]]
type DialDownPayload ¶
type DialDownPayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` }
DialDownPayload is sent when a Stream Deck + dial is pressed.
type DialRotateEvent ¶
type DialRotateEvent[S any] = ActionEvent[DialRotatePayload[S]]
type DialRotatePayload ¶
type DialRotatePayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` Ticks int `json:"ticks,omitempty"` Pressed bool `json:"pressed,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` }
DialRotatePayload is sent when a Stream Deck + dial is rotated.
type DialUpEvent ¶
type DialUpEvent[S any] = ActionEvent[DialUpPayload[S]]
type DialUpPayload ¶
type DialUpPayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` }
DialUpPayload is sent when a Stream Deck + dial is released.
type DidReceiveDeepLinkPayload ¶
type DidReceiveDeepLinkPayload struct {
URL string `json:"url,omitempty"`
}
DidReceiveDeepLinkPayload contains a deep-link path with the prefix omitted.
type DidReceiveGlobalSettingsPayload ¶
type DidReceiveGlobalSettingsPayload[T any] struct { Settings T `json:"settings,omitempty"` }
DidReceiveGlobalSettingsPayload contains plugin-wide settings.
type DidReceiveResourcesEvent ¶
type DidReceiveResourcesEvent[S any] = ActionEvent[DidReceiveResourcesPayload[S]]
type DidReceiveResourcesPayload ¶
type DidReceiveResourcesPayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` IsInMultiAction bool `json:"isInMultiAction,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` State *int `json:"state,omitempty"` }
DidReceiveResourcesPayload is returned for getResources and resource edits.
type DidReceiveSecretsPayload ¶
type DidReceiveSecretsPayload[T any] struct { Secrets T `json:"secrets,omitempty"` }
DidReceiveSecretsPayload contains plugin secrets.
type DidReceiveSettingsEvent ¶
type DidReceiveSettingsEvent[S any] = ActionEvent[DidReceiveSettingsPayload[S]]
type DidReceiveSettingsPayload ¶
type DidReceiveSettingsPayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` IsInMultiAction bool `json:"isInMultiAction,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` State *int `json:"state,omitempty"` }
DidReceiveSettingsPayload is returned for getSettings and property inspector edits.
type Event ¶
type Event struct {
Action string `json:"action,omitempty"`
Event EventName `json:"event,omitempty"`
UUID string `json:"uuid,omitempty"`
Context string `json:"context,omitempty"`
Device string `json:"device,omitempty"`
DeviceInfo DeviceInfo `json:"deviceInfo,omitempty"`
ID string `json:"id,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"`
}
Event is a received Stream Deck WebSocket message.
type EventHandler ¶
EventHandler handles a received event that is not bound to a registered action.
type EventName ¶
type EventName string
EventName is a Stream Deck WebSocket event or command name.
const ( DidReceiveSettings EventName = "didReceiveSettings" DidReceiveGlobalSettings EventName = "didReceiveGlobalSettings" DidReceiveResources EventName = "didReceiveResources" DidReceiveSecrets EventName = "didReceiveSecrets" DidReceiveDeepLink EventName = "didReceiveDeepLink" KeyDown EventName = "keyDown" KeyUp EventName = "keyUp" TouchTap EventName = "touchTap" DialDown EventName = "dialDown" DialUp EventName = "dialUp" DialRotate EventName = "dialRotate" WillAppear EventName = "willAppear" WillDisappear EventName = "willDisappear" TitleParametersDidChange EventName = "titleParametersDidChange" DeviceDidConnect EventName = "deviceDidConnect" DeviceDidDisconnect EventName = "deviceDidDisconnect" DeviceDidChange EventName = "deviceDidChange" ApplicationDidLaunch EventName = "applicationDidLaunch" ApplicationDidTerminate EventName = "applicationDidTerminate" SystemDidWakeUp EventName = "systemDidWakeUp" PropertyInspectorDidAppear EventName = "propertyInspectorDidAppear" PropertyInspectorDidDisappear EventName = "propertyInspectorDidDisappear" SendToPlugin EventName = "sendToPlugin" SendToPropertyInspector EventName = "sendToPropertyInspector" SetSettings EventName = "setSettings" GetSettings EventName = "getSettings" SetGlobalSettings EventName = "setGlobalSettings" GetGlobalSettings EventName = "getGlobalSettings" GetResources EventName = "getResources" SetResources EventName = "setResources" GetSecrets EventName = "getSecrets" OpenURL EventName = "openUrl" LogMessage EventName = "logMessage" SetTitle EventName = "setTitle" SetImage EventName = "setImage" SetFeedback EventName = "setFeedback" SetFeedbackLayout EventName = "setFeedbackLayout" SetTriggerDescription EventName = "setTriggerDescription" ShowAlert EventName = "showAlert" ShowOk EventName = "showOk" SetState EventName = "setState" SwitchToProfile EventName = "switchToProfile" )
type Feedback ¶
type Feedback map[string]FeedbackValue
Feedback updates Stream Deck + layout items by id.
func (Feedback) MarshalJSON ¶
type FeedbackFont ¶
type FeedbackFont struct {
Size *int `json:"size,omitempty"`
Weight *int `json:"weight,omitempty"`
}
FeedbackFont is a text item font.
type FeedbackNumber ¶
type FeedbackNumber float64
FeedbackNumber is a shorthand numeric layout value.
type FeedbackRange ¶
FeedbackRange is a min/max pair for bar and gauge items.
type FeedbackValue ¶
type FeedbackValue interface {
// contains filtered or unexported methods
}
FeedbackValue is a setFeedback item: a string, number, or typed layout object.
type GaugeBarFeedback ¶
type GaugeBarFeedback struct {
Background string `json:"background,omitempty"`
BarBgC string `json:"bar_bg_c,omitempty"`
BarBorderC string `json:"bar_border_c,omitempty"`
BarFillC string `json:"bar_fill_c,omitempty"`
BarH *int `json:"bar_h,omitempty"`
BorderW *int `json:"border_w,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Opacity *float64 `json:"opacity,omitempty"`
Range *FeedbackRange `json:"range,omitempty"`
Subtype *int `json:"subtype,omitempty"`
Value *float64 `json:"value,omitempty"`
ZOrder *int `json:"zOrder,omitempty"`
}
GaugeBarFeedback is a gauge-bar layout item.
type Info ¶
type Info struct {
Application Application `json:"application"`
Plugin Plugin `json:"plugin"`
DevicePixelRatio int `json:"devicePixelRatio"`
Colors Colors `json:"colors"`
Devices []Device `json:"devices"`
}
Info is the registration -info JSON object.
type KeyDownEvent ¶
type KeyDownEvent[S any] = ActionEvent[KeyDownPayload[S]]
type KeyDownPayload ¶
type KeyDownPayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` State *int `json:"state,omitempty"` UserDesiredState *int `json:"userDesiredState,omitempty"` IsInMultiAction bool `json:"isInMultiAction,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` }
KeyDownPayload is sent when a key is pressed.
type KeyUpEvent ¶
type KeyUpEvent[S any] = ActionEvent[KeyUpPayload[S]]
type KeyUpPayload ¶
type KeyUpPayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` State *int `json:"state,omitempty"` UserDesiredState *int `json:"userDesiredState,omitempty"` IsInMultiAction bool `json:"isInMultiAction,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` }
KeyUpPayload is sent when a key is released.
type LogMessagePayload ¶
type LogMessagePayload struct {
Message string `json:"message"`
}
LogMessagePayload is written to the Stream Deck log file.
type OpenURLPayload ¶
type OpenURLPayload struct {
URL string `json:"url"`
}
OpenURLPayload opens a URL in the default browser.
type PixmapFeedback ¶
type PixmapFeedback struct {
Background string `json:"background,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Opacity *float64 `json:"opacity,omitempty"`
Value string `json:"value,omitempty"`
ZOrder *int `json:"zOrder,omitempty"`
}
PixmapFeedback is an image layout item.
type PropertyInspectorDidAppearEvent ¶
type PropertyInspectorDidAppearEvent[S any] = ActionEvent[PropertyInspectorDidAppearPayload[S]]
type PropertyInspectorDidAppearPayload ¶
type PropertyInspectorDidAppearPayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` State *int `json:"state,omitempty"` IsInMultiAction bool `json:"isInMultiAction,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` }
PropertyInspectorDidAppearPayload is sent when the property inspector opens.
type PropertyInspectorDidDisappearEvent ¶
type PropertyInspectorDidDisappearEvent[S any] = ActionEvent[PropertyInspectorDidDisappearPayload[S]]
type PropertyInspectorDidDisappearPayload ¶
type PropertyInspectorDidDisappearPayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` State *int `json:"state,omitempty"` IsInMultiAction bool `json:"isInMultiAction,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` }
PropertyInspectorDidDisappearPayload is sent when the property inspector closes.
type RegistrationParams ¶
RegistrationParams are the command-line values Stream Deck passes to a plugin.
func ParseRegistrationParams ¶
func ParseRegistrationParams(args []string) (RegistrationParams, error)
ParseRegistrationParams parses Stream Deck launch arguments. Pass os.Args.
type SetFeedbackLayoutPayload ¶
type SetFeedbackLayoutPayload struct {
Layout string `json:"layout"`
}
SetFeedbackLayoutPayload selects a Stream Deck + layout.
type SetImagePayload ¶
type SetImagePayload struct {
Base64Image string `json:"image,omitempty"`
Target Target `json:"target,omitempty"`
State *int `json:"state,omitempty"`
}
SetImagePayload updates the image of an action instance.
type SetStatePayload ¶
type SetStatePayload struct {
State int `json:"state"`
}
SetStatePayload selects a multi-state action state.
type SetTitlePayload ¶
type SetTitlePayload struct {
Title string `json:"title,omitempty"`
Target Target `json:"target,omitempty"`
State *int `json:"state,omitempty"`
}
SetTitlePayload updates the title of an action instance.
type SetTriggerDescriptionPayload ¶
type SetTriggerDescriptionPayload struct {
LongTouch string `json:"longTouch,omitempty"`
Push string `json:"push,omitempty"`
Rotate string `json:"rotate,omitempty"`
Touch string `json:"touch,omitempty"`
}
SetTriggerDescriptionPayload updates encoder trigger descriptions.
type SwitchProfilePayload ¶
type SwitchProfilePayload struct {
Profile string `json:"profile,omitempty"`
Page *int `json:"page,omitempty"`
}
SwitchProfilePayload switches to a plugin-distributed profile.
type Target ¶
type Target int
Target specifies whether a title or image update applies to hardware, software, or both.
type TextAlignment ¶
type TextAlignment string
TextAlignment is a setFeedback text alignment.
const ( TextAlignCenter TextAlignment = "center" TextAlignLeft TextAlignment = "left" TextAlignRight TextAlignment = "right" )
type TextFeedback ¶
type TextFeedback struct {
Alignment TextAlignment `json:"alignment,omitempty"`
Background string `json:"background,omitempty"`
Color string `json:"color,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
Font *FeedbackFont `json:"font,omitempty"`
Opacity *float64 `json:"opacity,omitempty"`
TextOverflow TextOverflow `json:"text-overflow,omitempty"`
Value string `json:"value,omitempty"`
ZOrder *int `json:"zOrder,omitempty"`
}
TextFeedback is a text layout item.
type TextOverflow ¶
type TextOverflow string
TextOverflow is a setFeedback text overflow mode.
const ( TextOverflowClip TextOverflow = "clip" TextOverflowEllipsis TextOverflow = "ellipsis" TextOverflowFade TextOverflow = "fade" )
type TitleParameters ¶
type TitleParameters struct {
FontFamily string `json:"fontFamily,omitempty"`
FontSize int `json:"fontSize,omitempty"`
FontStyle string `json:"fontStyle,omitempty"`
FontUnderline bool `json:"fontUnderline,omitempty"`
ShowTitle bool `json:"showTitle,omitempty"`
TitleAlignment string `json:"titleAlignment,omitempty"`
TitleColor string `json:"titleColor,omitempty"`
}
TitleParameters describes how a title is rendered.
type TitleParametersDidChangeEvent ¶
type TitleParametersDidChangeEvent[S any] = ActionEvent[TitleParametersDidChangePayload[S]]
type TitleParametersDidChangePayload ¶
type TitleParametersDidChangePayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` State *int `json:"state,omitempty"` Title string `json:"title,omitempty"` TitleParameters TitleParameters `json:"titleParameters,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` }
TitleParametersDidChangePayload is sent when the user edits title parameters.
type TouchTapEvent ¶
type TouchTapEvent[S any] = ActionEvent[TouchTapPayload[S]]
type TouchTapPayload ¶
type TouchTapPayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` TapPos [2]int `json:"tapPos,omitempty"` Hold bool `json:"hold,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` }
TouchTapPayload is sent when a Stream Deck + touchscreen is tapped.
type WillAppearEvent ¶
type WillAppearEvent[S any] = ActionEvent[WillAppearPayload[S]]
type WillAppearPayload ¶
type WillAppearPayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` State *int `json:"state,omitempty"` IsInMultiAction bool `json:"isInMultiAction,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` }
WillAppearPayload is sent when an action instance becomes visible.
type WillDisappearEvent ¶
type WillDisappearEvent[S any] = ActionEvent[WillDisappearPayload[S]]
type WillDisappearPayload ¶
type WillDisappearPayload[T any] struct { Settings T `json:"settings,omitempty"` Coordinates *Coordinates `json:"coordinates,omitempty"` State *int `json:"state,omitempty"` IsInMultiAction bool `json:"isInMultiAction,omitempty"` Controller Controller `json:"controller,omitempty"` Resources map[string]string `json:"resources,omitempty"` }
WillDisappearPayload is sent when an action instance is hidden.