aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/crkbd/keymaps
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-10-16 20:33:55 -0700
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2018-10-28 08:44:58 -0700
commit76b5ac621d3f5f5e809de2bc9479d54b99a2f89f (patch)
tree652e2f9b27599849c7ee5c780e9ea34ec02a87e2 /keyboards/crkbd/keymaps
parent2776b9ee90d84b8a6c97e3e9395a8a87f499c5a9 (diff)
downloadfirmware-76b5ac621d3f5f5e809de2bc9479d54b99a2f89f.tar.gz
firmware-76b5ac621d3f5f5e809de2bc9479d54b99a2f89f.tar.bz2
firmware-76b5ac621d3f5f5e809de2bc9479d54b99a2f89f.zip
Update to Corne Keyboard (crkbd) keymap
Diffstat (limited to 'keyboards/crkbd/keymaps')
-rw-r--r--keyboards/crkbd/keymaps/drashna/keymap.c63
-rw-r--r--keyboards/crkbd/keymaps/drashna/rules.mk2
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 \