From 8f204691b1ebf8401adb10b57796b3fc9ac160ba Mon Sep 17 00:00:00 2001 From: John Ezra Date: Fri, 17 Sep 2021 15:40:21 -0700 Subject: [PATCH 1/2] added john ezra keymap with updates --- .../splitkb/kyria/keymaps/john-ezra/config.h | 15 +- .../splitkb/kyria/keymaps/john-ezra/keymap.c | 212 +++++++++--------- .../splitkb/kyria/keymaps/john-ezra/oled.c | 6 +- .../splitkb/kyria/keymaps/john-ezra/rules.mk | 1 + 4 files changed, 110 insertions(+), 124 deletions(-) diff --git a/keyboards/splitkb/kyria/keymaps/john-ezra/config.h b/keyboards/splitkb/kyria/keymaps/john-ezra/config.h index 3602b560c15f..7f9a48024f83 100644 --- a/keyboards/splitkb/kyria/keymaps/john-ezra/config.h +++ b/keyboards/splitkb/kyria/keymaps/john-ezra/config.h @@ -21,16 +21,11 @@ #endif #ifdef RGBLIGHT_ENABLE -#define RGBLIGHT_EFFECT_BREATHING -#define RGBLIGHT_EFFECT_RAINBOW_MOOD -#define RGBLIGHT_EFFECT_RAINBOW_SWIRL -#define RGBLIGHT_EFFECT_SNAKE -#define RGBLIGHT_EFFECT_KNIGHT -#define RGBLIGHT_EFFECT_CHRISTMAS -#define RGBLIGHT_EFFECT_STATIC_GRADIENT -#define RGBLIGHT_EFFECT_RGB_TEST -#define RGBLIGHT_EFFECT_ALTERNATING -#define RGBLIGHT_EFFECT_TWINKLE + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + #define RGBLIGHT_EFFECT_TWINKLE + #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/splitkb/kyria/keymaps/john-ezra/keymap.c b/keyboards/splitkb/kyria/keymaps/john-ezra/keymap.c index 3664fdfacf0d..f42cbf1d046b 100644 --- a/keyboards/splitkb/kyria/keymaps/john-ezra/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/john-ezra/keymap.c @@ -18,7 +18,6 @@ enum kyria_layers { _HNTS, - _QWERTY, _LOWER, _RAISE, _ADJUST @@ -26,17 +25,20 @@ enum kyria_layers { enum kyria_keycodes { HNTS = SAFE_RANGE, - QWERTY, LOWER, RAISE, CPY_PST, - UNDO + UNDO, + FIND }; +#define HNTS DF(_HNTS) +#define QWERTY DF(_QWERTY) #define BSP_CMD MT(MOD_LGUI, KC_BSPC) #define SFT_ENT MT(MOD_LSFT, KC_ENT) #define UNDO G(KC_Z) #define FIND G(KC_F) +#define MSS_CTL C(KC_UP) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -44,83 +46,62 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * Default: HNTS * * ,-----------------------------------------------. ,-----------------------------------------------. - * | ` | Z | R | L | D | W | | Y | P | U | X | Q | | \ | + * | Find | Z | R | L | D | W | | Y | P | U | X | Q | | \ | * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| - * | Esc | H | N | T | S | C | | B | I | E | O | A | Esc | + * |Cpy/Pst| H | N | T | S | C | | B | I | E | O | A | ` ~ | * |-------+-------+-------+-------+-------+-------+---------------. ,---------------+-------+-------+-------+-------+-------+-------| - * |Cpy/Pst| K | V | M | F | G | Ctrl | Alt | | Caps | Del | J | ; : | , < | . > | / ? | ' " | + * | Undo | K | V | M | F | G | Esc |MssnCtl| |MssnCtl| Esc | J | ; : | , < | . > | / ? | ' " | * `-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-----------------------' - * | Up | Down | Lower | Space | BSPC | | Tab | Shift | Raise | Left | Right | + * | Ctrl | Alt | Lower | Space | BSPC | | Tab | Shift | Raise | Del | Caps | * `---------------------------------------' `---------------------------------------' */ [_HNTS] = LAYOUT( FIND, KC_Z, KC_R, KC_L, KC_D, KC_W, KC_Y, KC_P, KC_U, KC_X, KC_Q, KC_BSLS, - CPY_PST, KC_H, KC_N, KC_T, KC_S, KC_C, KC_B, KC_I, KC_E, KC_O, KC_A, KC_ESC, - UNDO, KC_K, KC_V, KC_M, KC_F, KC_G, KC_LCTL, KC_LALT, KC_CAPS, KC_DEL, KC_J, KC_SCLN, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, - KC_UP, KC_DOWN, LOWER, KC_SPC, BSP_CMD, KC_TAB, SFT_ENT, RAISE, KC_LEFT, KC_RGHT + CPY_PST, KC_H, KC_N, KC_T, KC_S, KC_C, KC_B, KC_I, KC_E, KC_O, KC_A, KC_GRV, + UNDO, KC_K, KC_V, KC_M, KC_F, KC_G, KC_ESC, MSS_CTL, MSS_CTL, KC_ESC, KC_J, KC_SCLN, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LCTL, KC_LALT, LOWER, KC_SPC, BSP_CMD, KC_TAB, SFT_ENT, RAISE, KC_DEL, KC_CAPS ), /* - * Default: QWERTY + * Lower: Symbols & Media * * ,-----------------------------------------------. ,-----------------------------------------------. - * | ` | Q | W | E | R | T | | Y | U | I | O | P | | \ | + * | Tab | * | / | + | - | = | | | | { | } | @ | ! | ` | * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| - * | Esc | A | S | D | F | G | | H | J | K | L | ; | ' " | + * | Enter | Left | Up | Down | Right | | | \ | ( | ) | $ | # | ~ | * |-------+-------+-------+-------+-------+-------+---------------. ,---------------+-------+-------+-------+-------+-------+-------| - * |Cpy/Pst| Z | X | C | V | B | Ctrl | Alt | | Caps | Del | N | M | , < | . > | / ? |Cpy/Pst| - * `-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-----------------------' - * | Up | Down | Lower | Space | BSPC | | Tab | Shift | Raise | Left | Right | - * `---------------------------------------' `---------------------------------------' - */ - -[_QWERTY] = LAYOUT( - KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - CPY_PST, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_LALT, KC_CAPS, KC_DEL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, CPY_PST, - KC_UP, KC_DOWN, LOWER, KC_SPC, BSP_CMD, KC_TAB, SFT_ENT, RAISE, KC_LEFT, KC_RGHT -), - -/* - * Lower: Symbols - * - * ,-----------------------------------------------. ,-----------------------------------------------. - * | | ! | @ | { | } | | | | | | | | | | \ | - * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| - * | | # | $ | ( | ) | ` ~ | | + | - | * | / | = | | - * |-------+-------+-------+-------+-------+-------+---------------. ,---------------+-------+-------+-------+-------+-------+-------| - * | | % | ^ | [ | ] | & | | | | | | | | | | | | + * | Esc | Vol- | Vol+ | Prev | Play | Next | | | | | | _ | [ | ] | ^ | % | & | * `-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-----------------------' * | | | | | | | | | | | | * `---------------------------------------' `---------------------------------------' */ [_LOWER] = LAYOUT( - KC_GRV, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, _______, - KC_TILD, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_BSLS, KC_PLUS, KC_MINS, KC_ASTR, KC_SLSH, KC_EQL, _______, - KC_AMPR, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_UNDS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_TAB, KC_ASTR, KC_SLSH, KC_PLUS, KC_MINS, KC_EQL, KC_PIPE, KC_LCBR, KC_RCBR, KC_AT, KC_EXLM, KC_GRV, + KC_ENT, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, _______, KC_BSLS, KC_LPRN, KC_RPRN, KC_DLR, KC_HASH, KC_TILD, + KC_ESC, KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, KC_UNDS, KC_LBRC, KC_RBRC, KC_CIRC, KC_PERC, KC_AMPR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* - * Raise: Numbers & Media + * Raise: Numbers * * ,-----------------------------------------------. ,-----------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| - * | | Prev | Play | Next | VolUp | Mute | |Bright+| Left | Down | Up | Right | | + * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 | * |-------+-------+-------+-------+-------+-------+---------------. ,---------------+-------+-------+-------+-------+-------+-------| - * | | | | | VolDn | | | | | | |Bright-| | | | | | + * | | | | | | | | | | | | | Left | Up | Down | Right | Esc | * `-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-----------------------' * | | | | | | | | | | | | * `---------------------------------------' `---------------------------------------' */ [_RAISE] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - KC_VOLD, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_F12, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -128,86 +109,95 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * Adjust: Function Keys & RGB * * ,-----------------------------------------------. ,-----------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | + * | Reset | | | | | | | | NKRO |CG SWAP| | | HNTS | * |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| - * | | TOG | SAI | HUI | VAI | MOD | | | | | F11 | F12 | NKRO | + * | | TOG | SAI | HUI | VAI | MOD | | | | | | | | * |-------+-------+-------+-------+-------+-------+---------------. ,---------------+-------+-------+-------+-------+-------+-------| - * | | | SAD | HUD | VAD | RMOD | | | | | | | | | | | | + * | | | SAD | HUD | VAD | RMOD | | | | | | | |Bright+|Bright-| | | * `-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-----------------------' * | | | | | | | | | | | | * `---------------------------------------' `---------------------------------------' */ [_ADJUST] = LAYOUT( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, NK_TOGG, - _______, RGB_TOG, RGB_SAI, RGB_HUI, RGB_VAI, RGB_MOD, KC_BRIU, _______, _______, KC_F11, KC_F12, CG_TOGG, - _______, _______, RGB_SAD, RGB_HUD, RGB_VAD,RGB_RMOD,_______, _______, _______, _______, KC_BRID, _______, _______, _______, QWERTY, HNTS, + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, HNTS, + _______, RGB_TOG, RGB_SAI, RGB_HUI, RGB_VAI, RGB_MOD, CG_TOGG, NK_TOGG, KC_BRID, KC_BRIU, _______, _______, + _______, _______, RGB_SAD, RGB_HUD, RGB_VAD,RGB_RMOD,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case HNTS: //Layer Control - if (record->event.pressed) { - set_single_persistent_default_layer(_HNTS); - } - return false; - break; - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case CPY_PST: // One key copy/paste - { - static uint16_t copy_paste_timer; - if (record->event.pressed) { - copy_paste_timer = timer_read(); - } else { - if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy - register_mods(mod_config(MOD_LGUI)); - tap_code(KC_C); - unregister_mods(mod_config(MOD_LGUI)); - } else { // Tap, paste - register_mods(mod_config(MOD_LGUI)); - tap_code(KC_V); - unregister_mods(mod_config(MOD_LGUI)); - } - } - } - break; - case UNDO: // Undo Redo - if ((get_mods() & MOD_BIT(KC_LGUI)) == MOD_BIT(KC_LGUI)) { - if (record->event.pressed) { - register_code(KC_Y); - } else { - unregister_code(KC_Y); - } - return false; - } - return true; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case CPY_PST: // Hold to Copy, Hold with GUI to Cut, Tap to Paste + { + static uint16_t copy_paste_timer; + if (record->event.pressed) { + copy_paste_timer = timer_read(); + } else { + if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { + if (get_mods() & MOD_MASK_GUI) { + tap_code16(LGUI(KC_X)); + } else { + tap_code16(LGUI(KC_C)); + } + } else { + tap_code16(LGUI(KC_V)); + } + } + } + break; + case UNDO: // Tap to Undo, Tap with GUI to Redo + if (get_mods() & MOD_MASK_GUI) { + if (record->event.pressed) { + tap_code(KC_Y); + } + return false; + } + break; + case FIND: // Tap to Find, Tap with GUI to Select All + if (get_mods() & MOD_MASK_GUI) { + if (record->event.pressed) { + tap_code(KC_A); + } + return false; + } + break; } return true; }; + +const key_override_t ctrl_h = ko_make_basic(MOD_MASK_CTRL, KC_H, C(KC_LEFT)); //MocOS Desktop Navigation +const key_override_t ctrl_n = ko_make_basic(MOD_MASK_CTRL, KC_N, C(KC_UP)); //MocOS Desktop Navigation +const key_override_t ctrl_t = ko_make_basic(MOD_MASK_CTRL, KC_T, C(KC_DOWN)); //MocOS Desktop Navigation +const key_override_t ctrl_s = ko_make_basic(MOD_MASK_CTRL, KC_S, C(KC_RGHT)); //MocOS Desktop Navigation +const key_override_t bsp_del = ko_make_basic(MOD_MASK_SHIFT, BSP_CMD, KC_DEL); // Shift+Bksp sends Delete + +const key_override_t **key_overrides = (const key_override_t *[]){ + &ctrl_h, + &ctrl_n, + &ctrl_t, + &ctrl_s, + &bsp_del, + NULL +}; diff --git a/keyboards/splitkb/kyria/keymaps/john-ezra/oled.c b/keyboards/splitkb/kyria/keymaps/john-ezra/oled.c index d98cd598bc99..e0278391240c 100644 --- a/keyboards/splitkb/kyria/keymaps/john-ezra/oled.c +++ b/keyboards/splitkb/kyria/keymaps/john-ezra/oled.c @@ -113,13 +113,13 @@ static void render_status(void) { case 0: oled_write_P(PSTR("Default\n"), false); break; - case 2: + case 1: oled_write_P(PSTR("Lower\n"), false); break; - case 3: + case 2: oled_write_P(PSTR("Raise\n"), false); break; - case 4: + case 3: oled_write_P(PSTR("Adjust\n"), false); break; default: diff --git a/keyboards/splitkb/kyria/keymaps/john-ezra/rules.mk b/keyboards/splitkb/kyria/keymaps/john-ezra/rules.mk index 7fca028d2285..b86789c09ca9 100644 --- a/keyboards/splitkb/kyria/keymaps/john-ezra/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/john-ezra/rules.mk @@ -7,5 +7,6 @@ SPACE_CADET_ENABLE = no # Disable Space Cadet Shift GRAVE_ESC_ENABLE = no # Disable Grave Escape MOUSEKEY_ENABLE = no # Disable Mousekeys WPM_ENABLE = yes # Enable WPM Counter (Works with default wpm files, but works better with vectorstorm updated wpm.c and wpm.h -> https://github.com/vectorstorm/qmk_firmware/tree/wpm_exact) +KEY_OVERRIDE_ENABLE = yes # Enable Key Overrides SRC += oled.c From ea1c172aec79d79d89c4411c373ad563ab0fc21e Mon Sep 17 00:00:00 2001 From: John Ezra Date: Fri, 17 Sep 2021 16:14:56 -0700 Subject: [PATCH 2/2] changed tapping term --- keyboards/splitkb/kyria/keymaps/john-ezra/config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/splitkb/kyria/keymaps/john-ezra/config.h b/keyboards/splitkb/kyria/keymaps/john-ezra/config.h index 7f9a48024f83..77f095767dda 100644 --- a/keyboards/splitkb/kyria/keymaps/john-ezra/config.h +++ b/keyboards/splitkb/kyria/keymaps/john-ezra/config.h @@ -35,4 +35,6 @@ #undef DEBOUNCE #define DEBOUNCE 1 +#define TAPPING_TERM 125 + #define SPLIT_WPM_ENABLE