Documentation
¶
Index ¶
- Constants
- Variables
- func AddHandler(handler interface{}) func()
- func AddHandlerOnce(handler interface{}) func()
- func GetGlobalSettings()
- func GetSettings(context string)
- func JsonActionPayload(v *fastjson.Value) actionPayload
- func JsonKeyPayload(v *fastjson.Value) keyPayload
- func JsonStringValue(v *fastjson.Value, keys ...string) string
- func Log(message string)
- func Open() error
- func OpenURL(url string)
- func RegisterActionDown[T receivedPayload](actionName string, f ActionHandler[T])
- func RegisterActionUp[T receivedPayload](actionName string, f ActionHandler[T])
- func SendToPropertyInspector(context string, object interface{})
- func SetGlobalSettings(v interface{})
- func SetImage(context, imageData string, target int)
- func SetSettings(context string, v interface{})
- func SetState(context string, state int)
- func SetTitle(context, title string, target int)
- func ShowAlert(context string)
- func ShowOk(context string)
- func SwitchToProfile(context, profile string, page int)
- func Wait()
- type ActionHandler
- type ActionHandlerBase
- type ApplicationLaunchEvent
- type ApplicationTerminateEvent
- type Coordinates
- type DeviceConnectEvent
- type DeviceDisconnectEvent
- type DialDownEvent
- type DialRotateEvent
- type DialUpEvent
- type EventHandler
- type EventInterfaceProvider
- type GlobalSettingsEvent
- type KeyDownEvent
- type KeyUpEvent
- type PropertyInspectorDidAppearEvent
- type PropertyInspectorDidDisappearEvent
- type ReceiveSettingsEvent
- type SendToPluginEvent
- type Size
- type WillAppearEvent
- type WillDisappearEvent
Constants ¶
View Source
const ( CommonAction = "action" CommonEvent = "event" CommonContext = "context" CommonPayload = "payload" CommonDevice = "device" CommonDeviceInfo = "deviceInfo" EventKeyDown = "keyDown" EventKeyUp = "keyUp" EventWillAppear = "willAppear" EventWillDisappear = "willDisappear" EventDeviceDidConnect = "deviceDidConnect" EventDeviceDidDisconnect = "deviceDidDisconnect" EventApplicationDidLaunch = "applicationDidLaunch" EventApplicationDidTerminate = "applicationDidTerminate" EventTitleParametersDidChange = "titleParametersDidChange" EventDidReceiveSettings = "didReceiveSettings" EventDidReceiveGlobalSettings = "didReceiveGlobalSettings" EventPropertyInspectorDidAppear = "propertyInspectorDidAppear" EventPropertyInspectorDidDisappear = "propertyInspectorDidDisappear" EventDialDown = "dialDown" EventDialUp = "dialUp" EventDialRotate = "dialRotate" EventSetTitle = "setTitle" EventSetImage = "setImage" EventShowAlert = "showAlert" EventShowOK = "showOk" EventGetSettings = "getSettings" EventSetSettings = "setSettings" EventGetGlobalSettings = "getGlobalSettings" EventSetGlobalSettings = "setGlobalSettings" EventSetState = "setState" EventSwitchToProfile = "switchToProfile" EventSendToPropertyInspector = "sendToPropertyInspector" EventSendToPlugin = "sendToPlugin" EventOpenURL = "openUrl" EventLogMessage = "logMessage" TargetBoth = 0 TargetHardware = 1 TargetSoftware = 2 )
Variables ¶
View Source
var (
PluginUUID string
)
Functions ¶
func AddHandler ¶
func AddHandler(handler interface{}) func()
AddHandler allows you to add an event handler that will be fired anytime the Stream Deck event the function matches is received The second parameter is a pointer to a struct corresponding to the event for which you want to listen.
eg:
AddHandler(func(e *sdk.KeyDownEvent) {
})
or:
AddHandler(func(e *sdk.SendToPluginEvent) {
})
The return value of this method is a function, that when called will remove the event handler.
func AddHandlerOnce ¶
func AddHandlerOnce(handler interface{}) func()
AddHandlerOnce allows you to add an event handler that will be fired the next time the Discord WSAPI event that matches the function fire See AddHandler for more detail
func GetGlobalSettings ¶
func GetGlobalSettings()
func GetSettings ¶
func GetSettings(context string)
func JsonActionPayload ¶
func JsonKeyPayload ¶
func RegisterActionDown ¶
func RegisterActionDown[T receivedPayload](actionName string, f ActionHandler[T])
func RegisterActionUp ¶
func RegisterActionUp[T receivedPayload](actionName string, f ActionHandler[T])
func SendToPropertyInspector ¶
func SendToPropertyInspector(context string, object interface{})
func SetGlobalSettings ¶
func SetGlobalSettings(v interface{})
func SetSettings ¶
func SetSettings(context string, v interface{})
func SwitchToProfile ¶
Types ¶
type ActionHandler ¶
type ActionHandlerBase ¶
type ApplicationLaunchEvent ¶
type ApplicationLaunchEvent struct {
Application string
}
type ApplicationTerminateEvent ¶
type ApplicationTerminateEvent struct {
Application string
}
type Coordinates ¶
Coordinates on the device
func JsonCoordinates ¶
func JsonCoordinates(v *fastjson.Value) Coordinates
type DeviceConnectEvent ¶
type DeviceDisconnectEvent ¶
type DeviceDisconnectEvent struct {
DeviceId string
}
type DialDownEvent ¶
type DialRotateEvent ¶
type DialUpEvent ¶
type EventHandler ¶
type EventHandler interface {
// Type returns the type of event this handler belongs to.
Type() string
// Handle is called whenever an event of Type() happen
// It is the receivers responsibility to type assert that the interface
// is the expected struct.
Handle(interface{})
}
EventHandler is an interface for Discord event
type EventInterfaceProvider ¶
type EventInterfaceProvider interface {
// Type is the type of event this handler belongs to.
Type() string
// New returns a new instance of the struct this event handler handle
// This is called once per event.
// The struct is provided to all handlers of the same Type().
New() interface{}
}
EventInterfaceProvider is an interface for providing empty interfaces for Discord event
type GlobalSettingsEvent ¶
type KeyDownEvent ¶
type KeyUpEvent ¶
type ReceiveSettingsEvent ¶
type SendToPluginEvent ¶
type WillAppearEvent ¶
type WillDisappearEvent ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.