1
0
Fork 0

Update to Corne Keyboard (crkbd) keymap

This commit is contained in:
Drashna Jaelre 2018-10-16 20:33:55 -07:00 committed by MechMerlin
parent 2776b9ee90
commit 76b5ac621d
2 changed files with 39 additions and 26 deletions

View file

@ -113,12 +113,47 @@ const char *read_logo(void);
void set_keylog(uint16_t keycode, keyrecord_t *record); void set_keylog(uint16_t keycode, keyrecord_t *record);
const char *read_keylog(void); const char *read_keylog(void);
const char *read_keylogs(void); const char *read_keylogs(void);
char layer_state_str[24];
// const char *read_mode_icon(bool swap); // 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); // void set_timelog(void);
// const char *read_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) { void matrix_scan_keymap(void) {
iota_gfx_task(); 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_keylog());
matrix_write_ln(matrix, read_keylogs()); matrix_write_ln(matrix, read_keylogs());
//matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); //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()); //matrix_write_ln(matrix, read_timelog());
} else { } else {
matrix_write(matrix, read_logo()); matrix_write(matrix, read_logo());
@ -156,28 +191,6 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
set_keylog(keycode, record); set_keylog(keycode, record);
// set_timelog(); // 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; return true;
} }

View file

@ -26,6 +26,6 @@ SRC += ./lib/glcdfont.c \
./lib/layer_state_reader.c \ ./lib/layer_state_reader.c \
./lib/logo_reader.c \ ./lib/logo_reader.c \
./lib/keylogger.c \ ./lib/keylogger.c \
./lib/host_led_state_reader.c \
# ./lib/mode_icon_reader.c \ # ./lib/mode_icon_reader.c \
# ./lib/host_led_state_reader.c \
# ./lib/timelogger.c \ # ./lib/timelogger.c \