Browse Source

Add tapdance for GREETER

master
Ermer, Maximilian 4 months ago
parent
commit
4c8d6d4129
  1. 43
      keymap.c
  2. 1
      rules.mk

43
keymap.c

@ -20,11 +20,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "keymap_german.h"
enum custom_keycodes {
GREETER = SAFE_RANGE,
QWERTZ,
QWERTZ = SAFE_RANGE,
ADNW,
};
enum tapdance_codes {
TD_GREET = 0,
};
enum {_B_QWER, _B_ADNW, _NUM_R, _FUN_R, _MOUS_L, _NAV_L, _PUNC_R, _PUNC_L};
// For QWERTZ base layer
@ -81,7 +84,7 @@ combo_t key_combos[COMBO_COUNT] = {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_B_QWER] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
GREETER, DE_Q, DE_W, DE_E, DE_R, DE_T, DE_Z, DE_U, DE_I, DE_O, DE_P, DE_SS,
TD(TD_GREET), DE_Q, DE_W, DE_E, DE_R, DE_T, DE_Z, DE_U, DE_I, DE_O, DE_P, DE_SS,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
DM_PLY1, _GUI_A, _ALT_S, _CTL_D, _SFT_F, DE_G, DE_H, _SFT_J, _CTL_K, _ALT_L, _GUI_OE, DE_ADIA,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
@ -96,7 +99,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// My custom layout named "KoyKay"
[_B_ADNW] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
GREETER, DE_K, DE_DOT, DE_O, DE_COMM, DE_Y, DE_P, DE_D, DE_L, DE_M, DE_J, DE_SS,
TD(TD_GREET), DE_K, DE_DOT, DE_O, DE_COMM, DE_Y, DE_P, DE_D, DE_L, DE_M, DE_J, DE_SS,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
DM_PLY1, _GUI_H, _ALT_A, _CTL_E, _SFT_I, DE_U, DE_G, _SFT_T, _CTL_R, _ALT_N, _GUI_S, DE_F,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
@ -114,7 +117,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// XQÄÜÖ BPWMJ
[_B_ADNW] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
GREETER, DE_K, DE_DOT, DE_O, DE_COMM, DE_Y, DE_V, DE_G, DE_C, DE_L, DE_Z, DE_SS,
TD(TD_GREET), DE_K, DE_DOT, DE_O, DE_COMM, DE_Y, DE_V, DE_G, DE_C, DE_L, DE_Z, DE_SS,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
DM_PLY1, _GUI_H, _ALT_A, _CTL_E, _SFT_I, DE_U, DE_D, _SFT_T, _CTL_R, _ALT_N, _GUI_S, DE_F,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
@ -308,21 +311,23 @@ bool oled_task_user(void) {
return false;
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case GREETER:
if (record->event.pressed) {
// when keycode is pressed
SEND_STRING("Viele Gr");
tap_code(DE_UDIA);
tap_code(DE_SS);
SEND_STRING("e\nMax");
} else {
// when keycode is released
}
break;
void print_greeting (tap_dance_state_t *state, void *user_data) {
if (state->count == 1) {
SEND_STRING("Viele Gr");
tap_code(DE_UDIA);
tap_code(DE_SS);
SEND_STRING("e\nMax");
reset_tap_dance(state);
}
else if (state->count == 2) {
SEND_STRING("Best regards\n");
SEND_STRING("Max");
reset_tap_dance(state);
}
return true;
}
tap_dance_action_t tap_dance_actions[] = {
[TD_GREET] = ACTION_TAP_DANCE_FN(print_greeting),
};
#endif // OLED_DRIVER_ENABLE

1
rules.mk

@ -7,4 +7,5 @@ LTO_ENABLE = yes
CONSOLE_ENABLE = no
# AUTO_SHIFT_ENABLE = yes # Auto Shift
DYNAMIC_MACRO_ENABLE = yes
TAP_DANCE_ENABLE = yes
BOOTLOADER = qmk-hid
Loading…
Cancel
Save