migrate to oneshot homerow mods on extend layer, add leader + repeat key

This commit is contained in:
♥ Minnie ♥ 2024-01-29 22:35:46 +08:00
parent 48df21c453
commit 1b3a751c6a
5 changed files with 15 additions and 42 deletions

View file

@ -1,7 +1,6 @@
// name result chord keys // name result chord keys
COMB(NE_ESC, KC_ESC, KC_N, KC_E) COMB(NE_ESC, KC_ESC, KC_N, KC_E)
COMB(SE_CAPS, CW_TOGG, KC_S, KC_E) COMB(SE_CAPS, CW_TOGG, KC_S, KC_E)
COMB(ST_CTLW, LCTL(KC_W), KC_S, KC_T)
// unix shell // unix shell
SUBS(YP_HOME, "~/", KC_Y, KC_P) SUBS(YP_HOME, "~/", KC_Y, KC_P)
SUBS(FO_UPDIR, "../", KC_F, KC_O) SUBS(FO_UPDIR, "../", KC_F, KC_O)

View file

@ -33,7 +33,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
OS_LSFT, KC_Q, KC_J, KC_V, KC_D, KC_K, KC_X, KC_H, KC_SLSH, KC_COMM, KC_DOT, OS_RSFT, OS_LSFT, KC_Q, KC_J, KC_V, KC_D, KC_K, KC_X, KC_H, KC_SLSH, KC_COMM, KC_DOT, OS_RSFT,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
GUI_EXT, BAK_LWR, SPC_EXT, ENT_SFT, DEL_UPR, ALT_EXT QK_LEAD, BAK_LWR, SPC_EXT, ENT_SFT, DEL_UPR, QK_REP
//`--------------------------' `--------------------------'
),
[L_EXTEND] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL, KC_ESC,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
XXXXXXX, OS_LGUI, OS_LALT, OS_LSFT, OS_LCTL, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
XXXXXXX, XXXXXXX, XXXXXXX, _______, WZ_CMOD, WZ_PSTE
//`--------------------------' `--------------------------' //`--------------------------' `--------------------------'
), ),
@ -72,18 +84,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX
//`--------------------------' `--------------------------' //`--------------------------' `--------------------------'
), ),
[L_EXTEND] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
_______, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_5, KC_4, KC_3, KC_2, KC_1, KC_0, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
XXXXXXX, XXXXXXX, XXXXXXX, _______, WZ_CMOD, WZ_PSTE
//`--------------------------' `--------------------------'
),
}; };
/* Layer Change */ /* Layer Change */

View file

@ -6,32 +6,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!process_sentence_case(keycode, record)) { return false; } if (!process_sentence_case(keycode, record)) { return false; }
switch (keycode) { switch (keycode) {
case GUI_EXT:
if (record->tap.count && record->event.pressed) {
set_oneshot_mods(MOD_BIT(KC_LGUI));
return false;
} else if (record->event.pressed) {
register_mods(MOD_BIT(KC_LGUI));
layer_on(L_EXTEND);
} else {
unregister_mods(MOD_BIT(KC_LGUI));
layer_off(L_EXTEND);
}
return false;
case ALT_EXT:
if (record->tap.count && record->event.pressed) {
set_oneshot_mods(MOD_BIT(KC_LALT));
return false;
} else if (record->event.pressed) {
register_mods(MOD_BIT(KC_LALT));
layer_on(L_EXTEND);
} else {
unregister_mods(MOD_BIT(KC_LALT));
layer_off(L_EXTEND);
}
return false;
case BSPC_DW: case BSPC_DW:
if (record->tap.count && record->event.pressed) { if (record->tap.count && record->event.pressed) {
tap_code(KC_BSPC); tap_code(KC_BSPC);

View file

@ -9,14 +9,12 @@ enum custom_keycodes {
}; };
// Left-hand thumb key layers // Left-hand thumb key layers
#define GUI_EXT LT(L_EXTEND, KC_LGUI)
#define BAK_LWR LT(L_LOWER, KC_BSPC) #define BAK_LWR LT(L_LOWER, KC_BSPC)
#define SPC_EXT LT(L_EXTEND, KC_SPC) #define SPC_EXT LT(L_EXTEND, KC_SPC)
// Right-hand thumb key layers // Right-hand thumb key layers
#define ENT_SFT MT(MOD_LSFT, KC_ENT) #define ENT_SFT MT(MOD_LSFT, KC_ENT)
#define DEL_UPR LT(L_UPPER, KC_DEL) #define DEL_UPR LT(L_UPPER, KC_DEL)
#define ALT_EXT LT(L_EXTEND, KC_LALT)
// One Shot Keys // One Shot Keys
#define OS_LCTL OSM(MOD_LCTL) #define OS_LCTL OSM(MOD_LCTL)

View file

@ -8,6 +8,8 @@ LTO_ENABLE = yes
# Optional features # Optional features
OLED_ENABLE = yes OLED_ENABLE = yes
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
REPEAT_KEY_ENABLE = yes
LEADER_ENABLE = yes
# Toggleable through keymap # Toggleable through keymap
AUTO_SHIFT_ENABLE = yes AUTO_SHIFT_ENABLE = yes
AUTOCORRECT_ENABLE = yes AUTOCORRECT_ENABLE = yes