Skip to content

Commit ed18ab7

Browse files
committed
Add blank screen usable when idle
The MacroPad stays active including screen and lights even when the computer it is attached to, goes to sleep. This change provides a blank screen, sets all RGB lights to black and disables the bright background of the title bar when the title is empty (as on the blank screen).
1 parent c1a45d4 commit ed18ab7

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

Macropad_Hotkeys/code.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ def switch(self):
3535
""" Activate application settings; update OLED labels and LED
3636
colors. """
3737
group[13].text = self.name # Application name
38+
if self.name:
39+
rect.fill = 0xFFFFFF
40+
else: # empty app name indicates blank screen for which we dimm header
41+
rect.fill = 0x000000
3842
for i in range(12):
3943
if i < len(self.macros): # Key in use, set label + LED color
4044
macropad.pixels[i] = self.macros[i][0]
@@ -66,7 +70,8 @@ def switch(self):
6670
macropad.display.height - 1 -
6771
(3 - y) * 12),
6872
anchor_point=(x / 2, 1.0)))
69-
group.append(Rect(0, 0, macropad.display.width, 12, fill=0xFFFFFF))
73+
rect = Rect(0, 0, macropad.display.width, 12, fill=0xFFFFFF)
74+
group.append(rect)
7075
group.append(label.Label(terminalio.FONT, text='', color=0x000000,
7176
anchored_position=(macropad.display.width//2, -2),
7277
anchor_point=(0.5, 0.0)))
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# MACROPAD Hotkeys: blank screen for idle
2+
# Contributed by GitHub @vitoni
3+
4+
5+
app = { # REQUIRED dict, must be named 'app'
6+
'name' : '', # Application name
7+
'macros' : [ # List of button macros...
8+
# COLOR LABEL KEY SEQUENCE
9+
# 1st row ----------
10+
(0x000000, '', []),
11+
(0x000000, '', []),
12+
(0x000000, '', []),
13+
# 2nd row ----------
14+
(0x000000, '', []),
15+
(0x000000, '', []),
16+
(0x000000, '', []),
17+
# 3rd row ----------
18+
(0x000000, '', []),
19+
(0x000000, '', []),
20+
(0x000000, '', []),
21+
# 4th row ----------
22+
(0x000000, '', []),
23+
(0x000000, '', []),
24+
(0x000000, '', []),
25+
# Encoder button ---
26+
(0x000000, '', [])
27+
]
28+
}

0 commit comments

Comments
 (0)