summaryrefslogtreecommitdiff
path: root/keyboards/mechwild/mercutio/keymaps/jonavin/keymap.c
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-09-25 16:02:54 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-09-25 16:02:54 +0200
commit6afdd9d74da250e47ac64d6690bd19d037045e99 (patch)
tree661f6cfb244c02bcd1fbfe8fb9b2bd9242a91394 /keyboards/mechwild/mercutio/keymaps/jonavin/keymap.c
parent93a55e61b59d20f7cd842cce02e5b18a63a23612 (diff)
parent1bdf4cdc22ae57d111efb2f7d71e405e5c7b3f11 (diff)
downloadqmk_firmware-6afdd9d74da250e47ac64d6690bd19d037045e99.tar.gz
qmk_firmware-6afdd9d74da250e47ac64d6690bd19d037045e99.zip
Merge branch 'master' into taamas
Diffstat (limited to 'keyboards/mechwild/mercutio/keymaps/jonavin/keymap.c')
-rwxr-xr-xkeyboards/mechwild/mercutio/keymaps/jonavin/keymap.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/keyboards/mechwild/mercutio/keymaps/jonavin/keymap.c b/keyboards/mechwild/mercutio/keymaps/jonavin/keymap.c
index 869a9f73ab..5c22abee3f 100755
--- a/keyboards/mechwild/mercutio/keymaps/jonavin/keymap.c
+++ b/keyboards/mechwild/mercutio/keymaps/jonavin/keymap.c
@@ -17,7 +17,6 @@
#include QMK_KEYBOARD_H
-#include <stdio.h>
#include "jonavin.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -54,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
Defaults never changes if no encoder present to change it
*/
typedef struct {
- char keydesc[6]; // this will be displayed on OLED
+ char keydesc[6]; // this will be displayed on OLED
uint16_t keycode; // this is the keycode that will be sent when activted
} keycodedescType;
@@ -69,7 +68,7 @@ static const keycodedescType PROGMEM keyselection[] = {
{"C-A-D", KC_CAD}, // Ctrl-Alt-Del
{"AltF4", KC_AF4},
{"PLAY", KC_MEDIA_PLAY_PAUSE},
- {"RESET", RESET}, // firmware flash mode
+ {"FLASH", QK_BOOT}, // firmware flash mode
};
#define MAX_KEYSELECTION sizeof(keyselection)/sizeof(keyselection[0])
@@ -94,7 +93,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case ENCFUNC:
if (record->event.pressed) {
- selectedkey_rec.keycode == RESET ? reset_keyboard() : tap_code16(selectedkey_rec.keycode); // handle RESET code
+ selectedkey_rec.keycode == QK_BOOT ? reset_keyboard() : tap_code16(selectedkey_rec.keycode); // handle QK_BOOT code
} else {
// when keycode is released
}
@@ -153,7 +152,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
}
break;
}
- return true;
+ return false;
}
#endif
@@ -201,15 +200,13 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
}
render_logo();
oled_set_cursor(8,2);
- char fn_str[12];
switch(get_selected_layer()){
case 0:
oled_write_P(PSTR("BASE"), false);
break;
case 1:
- sprintf(fn_str, "FN %5s", selectedkey_rec.keydesc);
- oled_write(fn_str, false);
- //oled_write_P(PSTR("FN "), false);
+ oled_write_P(PSTR("FN "), false);
+ oled_write(selectedkey_rec.keydesc, false);
break;
case 2:
oled_write_P(PSTR("LOWER"), false);
@@ -230,8 +227,8 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
oled_write_P(PSTR("Temp BASE"), false);
break;
case 1:
- sprintf(fn_str, "Temp FN %5s", selectedkey_rec.keydesc);
- oled_write(fn_str, false);
+ oled_write_P(PSTR("Temp FN "), false);
+ oled_write(selectedkey_rec.keydesc, false);
break;
case 2:
oled_write_P(PSTR("Temp LOWER"), false);
@@ -246,12 +243,11 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
led_t led_state = host_keyboard_led_state();
oled_set_cursor(8,0);
uint8_t wpm_count;
- char wpm_str[10];
wpm_count=get_current_wpm();
if (wpm_count > 020) { // how wpm when > 20
- sprintf(wpm_str, " WPM: %03d", wpm_count);
- oled_write(wpm_str, false);
+ oled_write_P(PSTR(" WPM: "), false);
+ oled_write(get_u8_str(wpm_count, ' '), false);
} else {
oled_write_P(PSTR(" JONAVIN "), false); // otherwise display keymap name
}