1
0
Fork 0
mirror of https://github.com/Luzifer/streamdeck.git synced 2024-10-18 05:04:18 +00:00

BREAKING: Chance config to be a map of keys

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-06-06 17:48:52 +02:00
parent d68422f759
commit 3b9fd45282
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 1 additions and 9 deletions

View file

@ -12,7 +12,7 @@ type config struct {
}
type page struct {
Keys []keyDefinition `yaml:"keys"`
Keys map[int]keyDefinition `yaml:"keys"`
}
type keyDefinition struct {

View file

@ -1,14 +1,6 @@
package main
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{}
for len(blankPage.Keys) < sd.NumKeys() {
blankPage.Keys = append(blankPage.Keys, blankKey)
}
conf.Pages["@@blank"] = blankPage
}