mirror of
https://github.com/Luzifer/streamdeck.git
synced 2024-12-29 22:21:24 +00:00
BREAKING: Chance config to be a map of keys
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
d68422f759
commit
3b9fd45282
2 changed files with 1 additions and 9 deletions
|
@ -12,7 +12,7 @@ type config struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type page struct {
|
type page struct {
|
||||||
Keys []keyDefinition `yaml:"keys"`
|
Keys map[int]keyDefinition `yaml:"keys"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type keyDefinition struct {
|
type keyDefinition struct {
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
func applySystemPages(conf *config) {
|
func applySystemPages(conf *config) {
|
||||||
blankKey := keyDefinition{
|
|
||||||
Display: dynamicElement{Type: "color", Attributes: map[string]interface{}{"rgba": []interface{}{0x0, 0x0, 0x0, 0xff}}},
|
|
||||||
Actions: []dynamicElement{{Type: "page", Attributes: map[string]interface{}{"name": conf.DefaultPage}}},
|
|
||||||
}
|
|
||||||
|
|
||||||
blankPage := page{}
|
blankPage := page{}
|
||||||
for len(blankPage.Keys) < sd.NumKeys() {
|
|
||||||
blankPage.Keys = append(blankPage.Keys, blankKey)
|
|
||||||
}
|
|
||||||
conf.Pages["@@blank"] = blankPage
|
conf.Pages["@@blank"] = blankPage
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue