diff options
Diffstat (limited to 'keyboards/maartenwut/wonderland/keymaps/default/keymap.c')
| -rwxr-xr-x | keyboards/maartenwut/wonderland/keymaps/default/keymap.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/keyboards/maartenwut/wonderland/keymaps/default/keymap.c b/keyboards/maartenwut/wonderland/keymaps/default/keymap.c index ccb022f68..da03d7615 100755 --- a/keyboards/maartenwut/wonderland/keymaps/default/keymap.c +++ b/keyboards/maartenwut/wonderland/keymaps/default/keymap.c | |||
| @@ -22,3 +22,33 @@ RGB_RMOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | |||
| 22 | _______, KC_LALT, _______, _______, _______, KC_RALT, _______ \ | 22 | _______, KC_LALT, _______, _______, _______, KC_RALT, _______ \ |
| 23 | ) | 23 | ) |
| 24 | }; | 24 | }; |
| 25 | |||
| 26 | #ifdef USE_LEDS_FOR_LAYERS | ||
| 27 | // example of how to use LEDs as layer indicators | ||
| 28 | static uint8_t top = 1; | ||
| 29 | static uint8_t middle = 0; | ||
| 30 | static uint8_t bottom = 0; | ||
| 31 | |||
| 32 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
| 33 | top = middle = bottom = 0; | ||
| 34 | switch (get_highest_layer(state)) { | ||
| 35 | case _BASE: | ||
| 36 | top = 1; | ||
| 37 | break; | ||
| 38 | case _FUNC: | ||
| 39 | middle = 1; | ||
| 40 | break; | ||
| 41 | default: // for any other layers, or the default layer | ||
| 42 | break; | ||
| 43 | } | ||
| 44 | return state; | ||
| 45 | } | ||
| 46 | |||
| 47 | // override kb level function | ||
| 48 | bool led_update_user(led_t usb_led) { | ||
| 49 | writePin(B1, !top); | ||
| 50 | writePin(B2, !middle); | ||
| 51 | writePin(B3, !bottom); | ||
| 52 | return false; // we are using LEDs for something else override kb | ||
| 53 | } | ||
| 54 | #endif | ||
