-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathkey.go
More file actions
188 lines (150 loc) · 5.63 KB
/
Copy pathkey.go
File metadata and controls
188 lines (150 loc) · 5.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
package api
import "image"
type KeyBackgrounder interface {
GetKeyBackground() string
GetKeyBackgroundBuff() image.Image
SetKeyBackgroundBuff(img image.Image)
GetKeyBackgroundHandler() BackgroundHandler
SetKeyBackgroundHandler(handler BackgroundHandler)
GetKeyBackgroundHandlerFields() map[string]any
}
type KeyV3 struct {
Application map[string]*KeyConfigV3 `json:"application,omitempty"`
ActiveBuff image.Image `json:"-"`
ActiveIconHandlerStruct *ForegroundHandler `json:"-"`
ActiveKeyHandlerStruct *InputHandler `json:"-"`
ActiveApplication string `json:"-"`
KeyBackground string `json:"background"`
KeyBackgroundBuff image.Image `json:"-"`
KeyBackgroundHandler BackgroundHandler `json:"-"`
KeyBackgroundHandlerFields map[string]any `json:"key_background_handler_fields"`
}
func (k *KeyV3) GetKeyBackgroundHandlerFields() map[string]any {
return k.KeyBackgroundHandlerFields
}
func (k *KeyV3) GetKeyBackground() string {
return k.KeyBackground
}
func (k *KeyV3) GetKeyBackgroundBuff() image.Image {
return k.KeyBackgroundBuff
}
func (k *KeyV3) SetKeyBackgroundBuff(img image.Image) {
k.KeyBackgroundBuff = img
}
func (k *KeyV3) SetKeyBackgroundHandler(handler BackgroundHandler) {
k.KeyBackgroundHandler = handler
}
func (k *KeyV3) GetKeyBackgroundHandler() BackgroundHandler {
return k.KeyBackgroundHandler
}
type KeyConfigV3 struct {
Icon string `json:"icon,omitempty"`
Text string `json:"text,omitempty"`
TextSize int `json:"text_size,omitempty"`
TextAlignment VerticalAlignment `json:"text_alignment,omitempty"`
FontFace string `json:"font_face,omitempty"`
TextColour string `json:"text_colour,omitempty"`
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"`
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"`
SharedHandlerFields map[string]any `json:"shared_handler_fields,omitempty"`
IconHandlerStruct ForegroundHandler `json:"-"`
KeyHandlerStruct InputHandler `json:"-"`
KeyBackground string `json:"background"`
KeyBackgroundBuff image.Image `json:"-"`
KeyBackgroundHandler BackgroundHandler `json:"-"`
KeyBackgroundHandlerFields map[string]any `json:"key_background_handler_fields"`
}
func (kc *KeyConfigV3) SetForegroundHandlerInstance(handler ForegroundHandler) {
kc.IconHandlerStruct = handler
}
func (kc *KeyConfigV3) GetForegroundHandlerFields() map[string]any {
return kc.IconHandlerFields
}
func (kc *KeyConfigV3) GetForegroundHandlerInstance() ForegroundHandler {
return kc.IconHandlerStruct
}
func (kc *KeyConfigV3) GetForegroundHandler() string {
return kc.IconHandler
}
func (kc *KeyConfigV3) GetInputHandler() string {
return kc.KeyHandler
}
func (kc *KeyConfigV3) GetInputHandlerInstance() InputHandler {
return kc.KeyHandlerStruct
}
func (kc *KeyConfigV3) SetInputHandlerInstance(handler InputHandler) {
kc.KeyHandlerStruct = handler
}
func (kc *KeyConfigV3) GetInputHandlerFields() map[string]any {
return kc.KeyHandlerFields
}
func (kc *KeyConfigV3) GetSharedHandlerFields() map[string]any {
return kc.SharedHandlerFields
}
func (kc *KeyConfigV3) GetIcon() string {
return kc.Icon
}
func (kc *KeyConfigV3) GetText() string {
return kc.Text
}
func (kc *KeyConfigV3) GetTextSize() int {
return kc.TextSize
}
func (kc *KeyConfigV3) GetTextAlignment() VerticalAlignment {
return kc.TextAlignment
}
func (kc *KeyConfigV3) GetFontFace() string {
return kc.FontFace
}
func (kc *KeyConfigV3) GetTextColour() string {
return kc.TextColour
}
func (kc *KeyConfigV3) GetSwitchPage() int {
return kc.SwitchPage
}
func (kc *KeyConfigV3) GetKeyBind() string {
return kc.Keybind
}
func (kc *KeyConfigV3) GetCommand() string {
return kc.Command
}
func (kc *KeyConfigV3) GetBrightness() int {
return kc.Brightness
}
func (kc *KeyConfigV3) GetUrl() string {
return kc.Url
}
func (kc *KeyConfigV3) GetObsCommand() string {
return kc.ObsCommand
}
func (kc *KeyConfigV3) GetObsCommandParams() map[string]string {
return kc.ObsCommandParams
}
func (kc *KeyConfigV3) GetKeyBackgroundHandlerFields() map[string]any {
return kc.KeyBackgroundHandlerFields
}
func (kc *KeyConfigV3) GetKeyBackground() string {
return kc.KeyBackground
}
func (kc *KeyConfigV3) GetKeyBackgroundBuff() image.Image {
return kc.KeyBackgroundBuff
}
func (kc *KeyConfigV3) SetKeyBackgroundBuff(img image.Image) {
kc.KeyBackgroundBuff = img
}
func (kc *KeyConfigV3) SetKeyBackgroundHandler(handler BackgroundHandler) {
kc.KeyBackgroundHandler = handler
}
func (kc *KeyConfigV3) GetKeyBackgroundHandler() BackgroundHandler {
return kc.KeyBackgroundHandler
}