From 8fc91268be89ea167207c2175dda3b87b276286c Mon Sep 17 00:00:00 2001 From: MaxMalRichtig Date: Sun, 6 Feb 2022 21:42:14 +0100 Subject: [PATCH] Add 'GREETER' macro button --- keymap.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/keymap.c b/keymap.c index fc12479..7197f8b 100644 --- a/keymap.c +++ b/keymap.c @@ -19,6 +19,10 @@ along with this program. If not, see . #include QMK_KEYBOARD_H #include "keymap_german.h" +enum custom_keycodes { + GREETER = SAFE_RANGE, +}; + enum {_BASE, _NUM_R, _FUN_R, _MOUS_L, _NAV_L, _PUNC_R, _PUNC_L}; #define _GUI_A LGUI_T(DE_A) @@ -59,7 +63,7 @@ combo_t key_combos[COMBO_COUNT] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3( //,-----------------------------------------------------. ,-----------------------------------------------------. - XXXXXXX, DE_Q, DE_W, DE_E, DE_R, DE_T, DE_Z, DE_U, DE_I, DE_O, DE_P, DE_SS, + GREETER, DE_Q, DE_W, DE_E, DE_R, DE_T, DE_Z, DE_U, DE_I, DE_O, DE_P, DE_SS, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| XXXXXXX, _GUI_A, _ALT_S, _CTL_D, _SFT_F, DE_G, DE_H, _SFT_J, _CTL_K, _ALT_L, _GUI_OE, DE_ADIA, //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| @@ -241,9 +245,17 @@ bool oled_task_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - set_keylog(keycode, record); - } - return true; -} + switch (keycode) { + case GREETER: + if (record->event.pressed) { + // when keycode is pressed + SEND_STRING("Viele Grüße\nMax"); + } else { + // when keycode is released + } + break; + } + return true; +}; + #endif // OLED_DRIVER_ENABLE