Add a little visual feedback for the modifier key on the advanced HID example.

This commit is contained in:
sandyjmacdonald 2021-03-12 17:12:04 +00:00
parent 3fbf827b1e
commit 53ceeb5dcc

View file

@ -119,6 +119,9 @@ while True:
# This handles the modifier and layer selector behaviour
if modifier.held:
# Give some visual feedback for the modifier key
keys[0].led_off()
# If the modifier key is held, light up the layer selector keys
for layer in layers.keys():
keys[layer].set_led(*colours[layer])
@ -140,6 +143,9 @@ while True:
for layer in layers.keys():
keys[layer].led_off()
# Give some visual feedback for the modifier key
keys[0].set_led(0, 255, 25)
# Loop through all of the keys in the layer and if they're pressed, get the
# key code from the layer's key map
for k in layers[current_layer].keys():