Documentation
¶
Index ¶
- Constants
- Variables
- func AddHandler(handler interface{}) func()
- func AddHandlerOnce(handler interface{}) func()
- func GetGlobalSettings()
- func GetSettings(context string)
- func JsonStringValue(v *fastjson.Value, keys ...string) string
- func Log(message string)
- func Open() error
- func OpenURL(url string)
- func RegisterAction(actionName string, f ActionHandler)
- 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 Wait()
- type ActionHandler
- type ApplicationLaunchEvent
- type ApplicationTerminateEvent
- type DeviceConnectEvent
- type DeviceDisconnectEvent
- type EventHandler
- type EventInterfaceProvider
- type GlobalSettingsEvent
- type KeyDownEvent
- type KeyUpEvent
- type ReceiveSettingsEvent
- type SendToPluginEvent
- 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" 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 RegisterAction ¶
func RegisterAction(actionName string, f ActionHandler)
func SendToPropertyInspector ¶
func SendToPropertyInspector(context string, object interface{})
func SetGlobalSettings ¶
func SetGlobalSettings(v interface{})
func SetSettings ¶
func SetSettings(context string, v interface{})
Types ¶
type ActionHandler ¶
type ApplicationLaunchEvent ¶
type ApplicationLaunchEvent struct {
Application string
}
type ApplicationTerminateEvent ¶
type ApplicationTerminateEvent struct {
Application string
}
type DeviceConnectEvent ¶
type DeviceDisconnectEvent ¶
type DeviceDisconnectEvent struct {
DeviceId string
}
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 ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.