From c5d201b9750397139f20ad49f45da67c79aaaae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Kro=CC=88ger?= Date: Sun, 1 Oct 2023 20:16:20 +0200 Subject: [PATCH] Enable home row combo mods --- keyboards/handwired/tranquility/info.json | 4 ++- .../tranquility/keymaps/default/keymap.c | 26 ++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/keyboards/handwired/tranquility/info.json b/keyboards/handwired/tranquility/info.json index 1f080c40e0ee..581b3be305ce 100644 --- a/keyboards/handwired/tranquility/info.json +++ b/keyboards/handwired/tranquility/info.json @@ -5,7 +5,9 @@ "bootloader": "caterina", "diode_direction": "COL2ROW", "features": { - "extrakey": true + "bootmagic": true, + "extrakey": true, + "combo": true, }, "matrix_pins": { "cols": ["E6", "B4", "B5", "B6", "B2", "B3"], diff --git a/keyboards/handwired/tranquility/keymaps/default/keymap.c b/keyboards/handwired/tranquility/keymaps/default/keymap.c index 823f1c8f7f87..9eb27893ac2d 100644 --- a/keyboards/handwired/tranquility/keymaps/default/keymap.c +++ b/keyboards/handwired/tranquility/keymaps/default/keymap.c @@ -5,15 +5,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LGUI, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LALT, KC_LCTL, KC_SPC, KC_LSFT, RSFT_T(KC_ENT), KC_BSPC, LT(1, KC_DEL), KC_NO + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_NO, KC_TAB, KC_SPC, LSFT_T(KC_ESC), RSFT_T(KC_ENT), KC_BSPC, LT(1, KC_DEL), KC_NO ), [1] = LAYOUT( QK_BOOT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_F12, _______, _______, _______, _______, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, - _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, CG_TOGG, _______, _______, _______, _______, _______, _______, _______, _______ ), }; + +const uint16_t PROGMEM fd_combo[] = {KC_F, KC_D, COMBO_END}; +const uint16_t PROGMEM fs_combo[] = {KC_F, KC_S, COMBO_END}; +const uint16_t PROGMEM fa_combo[] = {KC_F, KC_A, COMBO_END}; +const uint16_t PROGMEM fds_combo[] = {KC_F, KC_D, KC_S, COMBO_END}; +const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END}; +const uint16_t PROGMEM jl_combo[] = {KC_J, KC_L, COMBO_END}; +const uint16_t PROGMEM jscln_combo[] = {KC_J, KC_SCLN, COMBO_END}; +const uint16_t PROGMEM jkl_combo[] = {KC_J, KC_K, KC_L, COMBO_END}; + +combo_t key_combos[] = { + COMBO(fd_combo, KC_LCTL), + COMBO(fs_combo, KC_LALT), + COMBO(fa_combo, KC_LGUI), + COMBO(fds_combo, LCTL(KC_LALT)), + COMBO(jk_combo, KC_LCTL), + COMBO(jl_combo, KC_LALT), + COMBO(jscln_combo, KC_LGUI), + COMBO(jkl_combo, LCTL(KC_LALT)), +};