summaryrefslogtreecommitdiff
path: root/src/skeleton.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/skeleton.py')
-rw-r--r--src/skeleton.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/skeleton.py b/src/skeleton.py
index 8497d34..1e4a03a 100644
--- a/src/skeleton.py
+++ b/src/skeleton.py
@@ -42,6 +42,9 @@ class Configuration(object):
# Set the application available in the menu by default
self.visible = True
+
+ self.is_layout = True
+
self.Action = namedtuple("Action", ("name", "callback", "color"))
self.title = title
self.keys = {
@@ -88,10 +91,16 @@ class Handler(object):
9 : None, 10 : None, 11 : None,
}
- self.options = configuration.group
+ self.stack(configuration)
+ def stack(self, configuration):
+ """ Add a new configuration on top of an existing one
+ """
+ self.group = displayio.Group()
self.name = configuration.title
+ self.options = configuration.group
+
for index, value in configuration.keys.items():
if value is None:
continue
@@ -112,6 +121,7 @@ class Handler(object):
self._update_tick()
self.macropad.pixels.show()
+
def _update_tick(self):
self.next_tick = ticks.add(
ticks_ms(),
@@ -162,8 +172,7 @@ class Handler(object):
self.macropad.consumer_control.release()
self.macropad.mouse.release_all()
self.macropad.stop_tone()
- for key in range(12):
- self._set_color(key, False)
+ self.macropad.pixels.fill((0, 0, 0))
self.macropad.pixels.show()
self.macropad.display.refresh()