diff options
Diffstat (limited to 'keyboards/crkbd')
-rw-r--r-- | keyboards/crkbd/keymaps/drashna/keymap.c | 63 | ||||
-rw-r--r-- | keyboards/crkbd/keymaps/drashna/rules.mk | 2 |
2 files changed, 39 insertions, 26 deletions
diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index a293d5337..49db492c4 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -113,12 +113,47 @@ const char *read_logo(void); void set_keylog(uint16_t keycode, keyrecord_t *record); const char *read_keylog(void); const char *read_keylogs(void); - +char layer_state_str[24]; // const char *read_mode_icon(bool swap); -// const char *read_host_led_state(void); +const char *read_host_led_state(void); // void set_timelog(void); // const char *read_timelog(void); + +const char* read_layer_state(void) { + switch (layer_state) { + case _QWERTY: + switch (default_layer_state) { + case _QWERTY: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: QWERTY"); + break; + case _COLEMAK: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Colemak"); + break; + case _DVORAK: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak"); + break; + case _WORKMAN: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Workman"); + break; + } + break; + case _RAISE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); + break; + case _LOWER: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); + break; + case _ADJUST: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); + break; + default: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); + } + + return layer_state_str; +} + void matrix_scan_keymap(void) { iota_gfx_task(); } @@ -130,7 +165,7 @@ void matrix_render_user(struct CharacterMatrix *matrix) { matrix_write_ln(matrix, read_keylog()); matrix_write_ln(matrix, read_keylogs()); //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); - //matrix_write_ln(matrix, read_host_led_state()); + matrix_write_ln(matrix, read_host_led_state()); //matrix_write_ln(matrix, read_timelog()); } else { matrix_write(matrix, read_logo()); @@ -156,28 +191,6 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { set_keylog(keycode, record); // set_timelog(); } - - switch (keycode) { - case RGB_MOD: - #ifdef RGBLIGHT_ENABLE - if (record->event.pressed) { - rgblight_mode_noeeprom(RGB_current_mode); - rgblight_step(); - RGB_current_mode = rgblight_config.mode; - } - #endif - return false; - break; - case RGBRST: - #ifdef RGBLIGHT_ENABLE - if (record->event.pressed) { - eeconfig_update_rgblight_default(); - rgblight_enable(); - RGB_current_mode = rgblight_config.mode; - } - #endif - break; - } return true; } diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index 8f69cba72..a4e1deba8 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk @@ -26,6 +26,6 @@ SRC += ./lib/glcdfont.c \ ./lib/layer_state_reader.c \ ./lib/logo_reader.c \ ./lib/keylogger.c \ + ./lib/host_led_state_reader.c \ # ./lib/mode_icon_reader.c \ - # ./lib/host_led_state_reader.c \ # ./lib/timelogger.c \ |