Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix corne keylog #22420

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions keyboards/crkbd/crkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ uint8_t last_col;
static const char PROGMEM code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};

static void set_keylog(uint16_t keycode, keyrecord_t *record) {
// save the row and column (useful even if we can't find a keycode to show)
last_row = record->event.key.row;
last_col = record->event.key.col;

key_name = ' ';
last_keycode = keycode;
if (IS_QK_MOD_TAP(keycode)) {
Expand All @@ -92,8 +96,6 @@ static void set_keylog(uint16_t keycode, keyrecord_t *record) {

// update keylog
key_name = pgm_read_byte(&code_to_name[keycode]);
last_row = record->event.key.row;
last_col = record->event.key.col;
}

static const char *depad_str(const char *depad_str, char depad_char) {
Expand All @@ -103,11 +105,9 @@ static const char *depad_str(const char *depad_str, char depad_char) {
}

static void oled_render_keylog(void) {
const char *last_row_str = get_u8_str(last_row, ' ');
oled_write(depad_str(last_row_str, ' '), false);
oled_write_char('0' + last_row, false);
oled_write_P(PSTR("x"), false);
const char *last_col_str = get_u8_str(last_col, ' ');
oled_write(depad_str(last_col_str, ' '), false);
oled_write_char('0' + last_col, false);
oled_write_P(PSTR(", k"), false);
const char *last_keycode_str = get_u16_str(last_keycode, ' ');
oled_write(depad_str(last_keycode_str, ' '), false);
Expand Down