summaryrefslogtreecommitdiff
path: root/keyboards/ergodox/keymaps
diff options
context:
space:
mode:
authorPavlos Vinieratos <pvinis@gmail.com>2016-12-09 16:00:46 +0100
committerPavlos Vinieratos <pvinis@gmail.com>2016-12-09 16:00:46 +0100
commit063ade6bb5963d21b1f466f3cad33fa72f1f06a8 (patch)
tree6ff271491894b40ecca1922dee114e22cbda0560 /keyboards/ergodox/keymaps
parentbe2863e56d2464170725cd6740f4d761e5102e48 (diff)
add light for some layers
Diffstat (limited to 'keyboards/ergodox/keymaps')
-rw-r--r--keyboards/ergodox/keymaps/pvinis/keymap.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/keyboards/ergodox/keymaps/pvinis/keymap.c b/keyboards/ergodox/keymaps/pvinis/keymap.c
index 0052a93251..52283a51e2 100644
--- a/keyboards/ergodox/keymaps/pvinis/keymap.c
+++ b/keyboards/ergodox/keymaps/pvinis/keymap.c
@@ -379,6 +379,25 @@ void matrix_init_user() {
ergodox_led_all_off();
}
+// light up leds based on the layer
+void matrix_scan_user(void) {
+ uint8_t layer = biton32(layer_state);
+
+ switch(layer) {
+ case SYSCTL:
+ ergodox_right_led_3_on();
+ break;
+ case MOUSE:
+ ergodox_right_led_2_on();
+ break;
+ default:
+ ergodox_right_led_1_off();
+ ergodox_right_led_2_off();
+ ergodox_right_led_3_off();
+ break;
+ }
+}
+
// extra keys
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch (id) {