diff options
Diffstat (limited to 'users/drashna/oled_stuff.c')
| -rw-r--r-- | users/drashna/oled_stuff.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/users/drashna/oled_stuff.c b/users/drashna/oled_stuff.c index debcdcfbe..0bdd0212b 100644 --- a/users/drashna/oled_stuff.c +++ b/users/drashna/oled_stuff.c | |||
| @@ -50,11 +50,17 @@ static const char PROGMEM code_to_name[0xFF] = { | |||
| 50 | }; | 50 | }; |
| 51 | // clang-format on | 51 | // clang-format on |
| 52 | 52 | ||
| 53 | void add_keylog(uint16_t keycode) { | 53 | void add_keylog(uint16_t keycode, keyrecord_t *record) { |
| 54 | if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { | 54 | if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX) || (keycode >= QK_MODS && keycode <= QK_MODS_MAX)) { |
| 55 | keycode = keycode & 0xFF; | 55 | if (((keycode & 0xFF) == KC_BSPC) && mod_config(get_mods() | get_oneshot_mods()) & MOD_MASK_CTRL) { |
| 56 | } else if (keycode > 0xFF) { | 56 | memset(keylog_str, ' ', sizeof(keylog_str) - 1); |
| 57 | keycode = 0; | 57 | return; |
| 58 | } | ||
| 59 | if (record->tap.count) { | ||
| 60 | keycode = keycode & 0xFF; | ||
| 61 | } else if (keycode > 0xFF) { | ||
| 62 | return; | ||
| 63 | } | ||
| 58 | } | 64 | } |
| 59 | 65 | ||
| 60 | for (uint8_t i = 1; i < KEYLOGGER_LENGTH; i++) { | 66 | for (uint8_t i = 1; i < KEYLOGGER_LENGTH; i++) { |
| @@ -72,7 +78,7 @@ bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) { | |||
| 72 | if (record->event.pressed) { | 78 | if (record->event.pressed) { |
| 73 | #ifdef OLED_ENABLE | 79 | #ifdef OLED_ENABLE |
| 74 | oled_timer = timer_read32(); | 80 | oled_timer = timer_read32(); |
| 75 | add_keylog(keycode); | 81 | add_keylog(keycode, record); |
| 76 | #endif | 82 | #endif |
| 77 | } | 83 | } |
| 78 | return true; | 84 | return true; |
| @@ -384,9 +390,8 @@ void render_status_main(void) { | |||
| 384 | __attribute__((weak)) oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return rotation; } | 390 | __attribute__((weak)) oled_rotation_t oled_init_keymap(oled_rotation_t rotation) { return rotation; } |
| 385 | 391 | ||
| 386 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { | 392 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { |
| 387 | for (uint8_t i = 0; i < (KEYLOGGER_LENGTH - 1); i++) { | 393 | memset(keylog_str, ' ', sizeof(keylog_str) - 1); |
| 388 | add_keylog(0); | 394 | |
| 389 | } | ||
| 390 | return oled_init_keymap(rotation); | 395 | return oled_init_keymap(rotation); |
| 391 | } | 396 | } |
| 392 | 397 | ||
