diff --git a/src/qmk/keyboards/handwired/rafaelromao/fauxberry/keymaps/rafaelromao/keymap.c b/src/qmk/keyboards/handwired/rafaelromao/fauxberry/keymaps/rafaelromao/keymap.c index c60756ae..59a4f3f9 100644 --- a/src/qmk/keyboards/handwired/rafaelromao/fauxberry/keymaps/rafaelromao/keymap.c +++ b/src/qmk/keyboards/handwired/rafaelromao/fauxberry/keymaps/rafaelromao/keymap.c @@ -65,6 +65,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ____ACCENT_L4____ , XXXXXXX , XXXXXXX , ____ACCENT_R4____), // |___________________________________________________________________________________________________| + [_FIXED_ACCENT] = LAYOUT_wrapper( + // |___________________________________________________________________________________________________| + ___________________ACCENT_L1_________ , XXXXXXX , XXXXXXX , _________ACCENT_R1___________________ , + // |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + ___________________ACCENT_L2___________________ , ___________________ACCENT_R2___________________ , + // |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + XXXXXXX , _________ACCENT_L3___________________ , ___________________ACCENT_R3_________ , XXXXXXX , + // |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + ____ACCENT_L4____ , XXXXXXX , XXXXXXX , ____ACCENT_R4____), + // |___________________________________________________________________________________________________| + [_LOWER] = LAYOUT_wrapper( // |___________________________________________________________________________________________________| ___________________LOWER_L1__________ , XXXXXXX , XXXXXXX , _________LOWER_R1____________________ , diff --git a/src/qmk/keyboards/handwired/rafaelromao/rommana/keymaps/rafaelromao/keymap.c b/src/qmk/keyboards/handwired/rafaelromao/rommana/keymaps/rafaelromao/keymap.c index 10f2e213..a8b9cb58 100644 --- a/src/qmk/keyboards/handwired/rafaelromao/rommana/keymaps/rafaelromao/keymap.c +++ b/src/qmk/keyboards/handwired/rafaelromao/rommana/keymaps/rafaelromao/keymap.c @@ -65,6 +65,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ____ACCENT_L4____ , ____ACCENT_R4____), // |___________________________________________________________________________________________________| + [_FIXED_ACCENT] = LAYOUT_wrapper( + // |___________________________________________________________________________________________________| + ___________________ACCENT_L1_________ , _________ACCENT_R1___________________ , + // |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + ___________________ACCENT_L2___________________ , ___________________ACCENT_R2___________________ , + // |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _________ACCENT_L3___________________ , ___________________ACCENT_R3_________ , + // |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + ____ACCENT_L4____ , ____ACCENT_R4____), + // |___________________________________________________________________________________________________| + [_LOWER] = LAYOUT_wrapper( // |___________________________________________________________________________________________________| ___________________LOWER_L1__________ , _________LOWER_R1____________________ , diff --git a/src/qmk/keyboards/handwired/rafaelromao/wizza/keymaps/rafaelromao/keymap.c b/src/qmk/keyboards/handwired/rafaelromao/wizza/keymaps/rafaelromao/keymap.c index dd14f646..45639f6b 100644 --- a/src/qmk/keyboards/handwired/rafaelromao/wizza/keymaps/rafaelromao/keymap.c +++ b/src/qmk/keyboards/handwired/rafaelromao/wizza/keymaps/rafaelromao/keymap.c @@ -65,6 +65,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ____ACCENT_L4____ , ____ACCENT_R4____), // |___________________________________________________________________________________________________| + [_FIXED_ACCENT] = LAYOUT_wrapper( + // |___________________________________________________________________________________________________| + ___________________ACCENT_L1_________ , _________ACCENT_R1___________________ , + // |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + ___________________ACCENT_L2___________________ , ___________________ACCENT_R2___________________ , + // |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + _________ACCENT_L3___________________ , ___________________ACCENT_R3_________ , + // |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + ____ACCENT_L4____ , ____ACCENT_R4____), + // |___________________________________________________________________________________________________| + [_LOWER] = LAYOUT_wrapper( // |___________________________________________________________________________________________________| ___________________LOWER_L1__________ , _________LOWER_R1____________________ , diff --git a/src/qmk/keyboards/kprepublic/bm40hsrgb/keymaps/rafaelromao/keymap.c b/src/qmk/keyboards/kprepublic/bm40hsrgb/keymaps/rafaelromao/keymap.c index 9a496a30..e81d133e 100644 --- a/src/qmk/keyboards/kprepublic/bm40hsrgb/keymaps/rafaelromao/keymap.c +++ b/src/qmk/keyboards/kprepublic/bm40hsrgb/keymaps/rafaelromao/keymap.c @@ -65,6 +65,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX , XXXXXXX , XXXXXXX , ____ACCENT_L4____ , XXXXXXX , ____ACCENT_R4____ , XXXXXXX , XXXXXXX , XXXXXXX), // |_______________________________________________________________________________________________________________________| + [_FIXED_ACCENT] = LAYOUT_wrapper( + // |_______________________________________________________________________________________________________________________| + ___________________ACCENT_L1_________ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _________ACCENT_R1___________________ , + // |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + ___________________ACCENT_L2___________________ , XXXXXXX , XXXXXXX , ___________________ACCENT_R2___________________ , + // |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + XXXXXXX , _________ACCENT_L3___________________ , XXXXXXX , XXXXXXX , ___________________ACCENT_R3_________ , XXXXXXX , + // |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| + XXXXXXX , XXXXXXX , XXXXXXX , ____ACCENT_L4____ , XXXXXXX , ____ACCENT_R4____ , XXXXXXX , XXXXXXX , XXXXXXX), + // |_______________________________________________________________________________________________________________________| + [_LOWER] = LAYOUT_wrapper( // |_______________________________________________________________________________________________________________________| ___________________LOWER_L1__________ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _________LOWER_R1____________________ , diff --git a/src/qmk/users/rafaelromao/definitions/keycodes.h b/src/qmk/users/rafaelromao/definitions/keycodes.h index a8c86601..b646403c 100644 --- a/src/qmk/users/rafaelromao/definitions/keycodes.h +++ b/src/qmk/users/rafaelromao/definitions/keycodes.h @@ -193,20 +193,20 @@ enum { #define QBT_RST LT(_MAINTENANCE, QK_BOOT) // Both Tap and Hold behaviors will be intercepted #define NMO_SPC LT(_NOMOD, KC_SPC) -#define ACT_SPC LT(_ACCENT, KC_SPC) +#define ACT_SPC LT(_FIXED_ACCENT, KC_SPC) #define LOW_SPC LT(_LOWER, KC_SPC) #define LOW_NSE LT(_LOWER, MC_NSEN) #define RAI_TAC LT(_RAISE, TG_ACNT) #define RAI_SPC LT(_RAISE, KC_SPC) #define RAI_ACT OSL(_ACCENT) // Hold behavior is implemented in intercepted code -#define MED_OSF OSM(MOD_LSFT) // Hold behavior is implemented in intercepted code +#define MED_OSF LT(_MEDIA, OS_LSFT) // Hold and tap behaviors are implemented in intercepted code #define MAC_KCD LT(_MACROS, KC_D) #define MAC_KCI LT(_MACROS, KC_I) #define MAC_DOT LT(_MACROS, KC_DOT) // Layer transitions -#define MO_ACT MO(_ACCENT) +#define MO_ACT MO(_FIXED_ACCENT) #define MO_MED MO(_MEDIA) #define TO_ROM TO(_ROMAK) #define TG_NUM TG(_NUMPAD) diff --git a/src/qmk/users/rafaelromao/definitions/layers.h b/src/qmk/users/rafaelromao/definitions/layers.h index 7a97fff1..b54e55b2 100644 --- a/src/qmk/users/rafaelromao/definitions/layers.h +++ b/src/qmk/users/rafaelromao/definitions/layers.h @@ -6,6 +6,7 @@ typedef enum { _MACROS, _NOMOD, _ACCENT, + _FIXED_ACCENT, _LOWER, _RAISE, _SEN_CASE, diff --git a/src/qmk/users/rafaelromao/features/sentence_case.c b/src/qmk/users/rafaelromao/features/sentence_case.c index 27b5497c..16df459d 100644 --- a/src/qmk/users/rafaelromao/features/sentence_case.c +++ b/src/qmk/users/rafaelromao/features/sentence_case.c @@ -3,6 +3,9 @@ #include "sentence_case.h" process_record_result_t process_sentence_case(uint16_t keycode, keyrecord_t *record) { + bool isOneShotLockedShift = get_oneshot_locked_mods() & MOD_MASK_SHIFT; + bool isOneShotShift = isOneShotLockedShift || get_oneshot_mods() & MOD_MASK_SHIFT; + switch (keycode) { case NAV_CAN: if (record->tap.count == 0) { @@ -16,10 +19,9 @@ process_record_result_t process_sentence_case(uint16_t keycode, keyrecord_t *rec if (record->event.pressed) { disable_smart_case(); clear_shift(); - return PROCESS_RECORD_RETURN_FALSE; } } - break; + return PROCESS_RECORD_RETURN_FALSE; case LOW_NSE: if (record->tap.count == 0) { @@ -46,9 +48,16 @@ process_record_result_t process_sentence_case(uint16_t keycode, keyrecord_t *rec } else { layer_off(_MEDIA); } - return PROCESS_RECORD_RETURN_FALSE; + } else { + if (record->event.pressed) { + set_oneshot_layer(_SEN_CASE, ONESHOT_START); + reset_oneshot_timer(); + if (!isOneShotShift) { + add_oneshot_mods(MOD_LSFT); + } + } } - break; + return PROCESS_RECORD_RETURN_FALSE; } return PROCESS_RECORD_CONTINUE; diff --git a/src/zmk/config/definitions/config.dtsi b/src/zmk/config/definitions/config.dtsi index 0fcbb9a7..15f911c7 100644 --- a/src/zmk/config/definitions/config.dtsi +++ b/src/zmk/config/definitions/config.dtsi @@ -16,11 +16,13 @@ #define LOWER 8 #define RAISE 9 #define SEN_CASE 10 -#define NAV_F 11 -#define MEDIA 12 -#define NAV 13 -#define LOCK_KB 14 -#define MAINT 15 +#define SEN_E1 11 +#define SEN_E2 12 +#define NAV_F 13 +#define MEDIA 14 +#define NAV 15 +#define LOCK_KB 16 +#define MAINT 17 #define TAPPING_TERM 175 #define TD_TAPPING_TERM 225 diff --git a/src/zmk/config/definitions/keymap.dtsi b/src/zmk/config/definitions/keymap.dtsi index 643b317f..1efb4fda 100644 --- a/src/zmk/config/definitions/keymap.dtsi +++ b/src/zmk/config/definitions/keymap.dtsi @@ -118,7 +118,25 @@ &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans - &trans &th_cancel NAV 0 &th_nsen LOWER 0 &trans &msk MEDIA LSHFT &trans + &trans &th_cancel NAV 0 &th_sp_ns LOWER 0 &trans &th_nsen MEDIA 0 &trans + >; + }; + sentence_case_ext1_layer { + label = "SEN_CS_EXT1"; + bindings = < + &trans &kp LS(B) &kp LS(M) &kp LS(G) &kp LS(K) &kp LS(X) &kp LS(L) &kp LS(O) &kp LS(U) &trans + < MACROS LS(D) &mt LSHFT LS(N) &mt LCTRL LS(S) &mt LGUI LS(T) &kp LS(W) &kp LS(Z) &mt RGUI LS(R) &mt RCTRL LS(A) &mt RSHFT LS(E) < MACROS LS(I) + &kp LS(Q) &mt RALT LS(F) &kp LS(C) &mt LALT LS(P) &kp LS(V) &kp LS(J) &mt LALT LS(H) &th_comma 0 0 &th_dot 0 0 &kp LS(Y) + &trans &th_cancel NAV 0 &th_sp_ns LOWER 0 &msl RAISE SEN_E2 &th_nsen MEDIA 0 &trans + >; + }; + sentence_case_ext2_layer { + label = "SEN_CS_EXT2"; + bindings = < + &trans &kp LS(J) &kp LS(V) &kp LS(W) &none &none &ac_agrv_c &ac_oacu_c &ac_uacu_c &trans + &kp LS(Y) &kp LS(Z) &kp LS(X) &kp LS(K) &kp SQT &kp CARET &ac_atil_c &ac_aacu_c &ac_eacu_c &ac_iacu_c + &none &kp LS(Q) &mc_ced_c &mc_qu_c &kp GRAVE &kp TILDE &ac_acir_c &ac_ocir_c &ac_ecir_c &none + &trans &th_cancel NAV 0 &th_sp_ns LOWER 0 &none &th_nsen MEDIA 0 &trans >; }; fixed_navigation_layer { diff --git a/src/zmk/config/features/symbols.dtsi b/src/zmk/config/features/symbols.dtsi index 0b25e448..455ab6b9 100644 --- a/src/zmk/config/features/symbols.dtsi +++ b/src/zmk/config/features/symbols.dtsi @@ -80,182 +80,177 @@ bindings = , , ; \ }; - symbols { - - // Romak - - SHIFTED_SYMBOL(mm_semi, &kp SEMI, &kp COLON) - SYMBOL(mc_end_semi, &kp END &kp SEMI) - TAPHOLD_SYMBOL(th_semi, &mm_semi, &mc_end_semi) - - SYMBOL(mc_epa, ¯o_tap &kp ESC &kp P &kp J) - SYMBOL(mc_end_semi_ent, &kp END &kp SEMI &kp ENTER) - TAPHOLD_SYMBOL(th_epa, &mc_epa, &mc_end_semi_ent) - - SHIFTED_SYMBOL(mm_unds, &kp UNDERSCORE, &kp MINUS) - - SYMBOL(mc_dot, &kp DOT &sl SEN_CASE) - SYMBOL(mc_end_dot, &kp END &kp DOT &sl SEN_CASE) - TAPHOLD_SYMBOL(th_dot, &mc_dot, &mc_end_dot) - - SYMBOL(mc_comma, &kp COMMA) - SYMBOL(mc_end_comma, &kp END &kp COMMA) - TAPHOLD_SYMBOL(th_comma, &mc_comma, &mc_end_comma) - - // Lower - - SHIFTED_SYMBOL(mc_n0, &kp N0, &kp KP_N0) - SHIFTED_SYMBOL(mc_n1, &kp N1, &kp KP_N1) - SHIFTED_SYMBOL(mc_n2, &kp N2, &kp KP_N2) - SHIFTED_SYMBOL(mc_n3, &kp N3, &kp KP_N3) - SHIFTED_SYMBOL(mc_n4, &kp N4, &kp KP_N4) - SHIFTED_SYMBOL(mc_n5, &kp N5, &kp KP_N5) - SHIFTED_SYMBOL(mc_n6, &kp N6, &kp KP_N6) - SHIFTED_SYMBOL(mc_n7, &kp N7, &kp KP_N7) - SHIFTED_SYMBOL(mc_n8, &kp N8, &kp KP_N8) - SHIFTED_SYMBOL(mc_n9, &kp N9, &kp KP_N9) - - LAYERTAP_SYMBOL(th_n0, &mc_n0) - MODTAP_SYMBOL(th_n1, &mc_n1) - MODTAP_SYMBOL(th_n4, &mc_n4) - MODTAP_SYMBOL(th_n5, &mc_n5) - MODTAP_SYMBOL(th_n6, &mc_n6) - - SYMBOL(mc_lpar, &kp LPAR) - SYMBOL(mc_end_lpar, &kp END &kp LPAR) - TAPHOLD_SYMBOL(th_lpar, &mc_lpar, &mc_end_lpar) - MACRO_SYMBOL(mc_for, &kp F &kp O &kp R &kp LPAR) - TAPDANCE_SYMBOL(td_lpar, &th_lpar 0 0, &mc_for, &none) - - SYMBOL(mc_rpar, &kp RPAR) - SYMBOL(mc_end_rpar, &kp END &kp RPAR) - TAPHOLD_SYMBOL(th_rpar, &mc_rpar, &mc_end_rpar) - MACRO_SYMBOL(mc_if, &kp I &kp F &kp LPAR) - TAPDANCE_SYMBOL(td_rpar, &th_rpar 0 0, &mc_if, &none) - - SYMBOL(mc_pars, &kp LPAR &kp RPAR) - SYMBOL(mc_end_pars, &kp END &kp LPAR &kp RPAR) - TAPHOLD_SYMBOL(th_pars, &mc_pars, &mc_end_pars) - - SYMBOL(mc_bti, &kp GRAVE &kp SPACE) - - SYMBOL(mc_dqo, &kp DQT &kp SPACE) - SYMBOL(mc_end_dqo, &kp END &mc_dqo) - SYMBOL(mc_double_dqo, &mc_dqo &mc_dqo &kp LEFT) - TAPHOLD_SYMBOL(th_dqo, &mc_dqo, &mc_end_dqo) - TAPDANCE_SYMBOL(td_dqo, &th_dqo 0 0, &mc_double_dqo, &none) - - SYMBOL(mc_sqo, &kp SQT &kp SPACE) - - SYMBOL(mc_lbkt, &kp LBKT) - SYMBOL(mc_end_lbkt, &kp END &kp LBKT) - MACRO_SYMBOL(mc_switch, &kp S &kp W &kp I &kp T &kp C &kp H &kp LPAR) - TAPHOLD_SYMBOL(th_lbkt, &mc_lbkt, &mc_end_lbkt) - TAPDANCE_SYMBOL(td_lbkt, &th_lbkt 0 0, &mc_switch, &none) - - SYMBOL(mc_rbkt, &kp RBKT) - SYMBOL(mc_end_rbkt, &kp END &kp RBKT) - MACRO_SYMBOL(mc_case, &kp C &kp A &kp S &kp E &kp SPACE) - TAPHOLD_SYMBOL(th_rbkt, &mc_rbkt, &mc_end_rbkt) - TAPDANCE_SYMBOL(td_rbkt, &th_rbkt 0 0, &mc_case, &none) - - SYMBOL(mc_qmark, &kp QMARK &sl SEN_CASE) - SYMBOL(mc_end_qmark, &kp END &kp QMARK &sl SEN_CASE) - TAPHOLD_SYMBOL(th_qmark, &mc_qmark, &mc_end_qmark) - - SYMBOL(mc_and, &kp AMPS) - SYMBOL(mc_right_and, &kp RIGHT &kp AMPS &kp AMPS) - TAPHOLD_SYMBOL(th_and, &mc_and, &mc_right_and) - - SYMBOL(mc_or, &kp PIPE) - SYMBOL(mc_right_or, &kp RIGHT &kp PIPE &kp PIPE) - TAPHOLD_SYMBOL(th_or, &mc_or, &mc_right_or) - - // Raise - - SYMBOL(mc_lbrc, &kp LBRC) - SYMBOL(mc_end_lbrc, &kp END &kp LBRC) - TAPHOLD_SYMBOL(th_lbrc, &mc_lbrc, &mc_end_lbrc) - MACRO_SYMBOL(mc_var, &kp V &kp A &kp R &kp SPACE) - TAPDANCE_SYMBOL(td_lbrc, &th_lbrc 0 0, &mc_var, &none) - - SYMBOL(mc_rbrc, &kp RBRC) - SYMBOL(mc_end_rbrc, &kp END &kp RBRC) - TAPHOLD_SYMBOL(th_rbrc, &mc_rbrc, &mc_end_rbrc) - MACRO_SYMBOL(mc_return, &kp R &kp E &kp T &kp U &kp R &kp N &kp SPACE) - TAPDANCE_SYMBOL(td_rbrc, &th_rbrc 0 0, &mc_return, &none) - - SYMBOL(mc_braces, &kp END &kp LBRC &kp RBRC &kp LEFT &kp ENTER) - - SYMBOL(mc_dollar, &kp DOLLAR) - SYMBOL(mc_caret, &kp CARET &kp SPACE) - SYMBOL(mc_euro, &kp LS(LA(N2))) - TAPHOLD_SYMBOL(th_curr, &mc_caret, &mc_dollar) - TAPDANCE_SYMBOL(td_curr, &th_curr 0 0, &mc_euro, &none) - - SYMBOL(mc_colon, &kp COLON) - SYMBOL(mc_end_colon, &kp END &kp COLON) - TAPHOLD_SYMBOL(th_colon, &mc_colon, &mc_end_colon) - - SYMBOL(mc_sarrow, &kp MINUS &kp GT) - SYMBOL(mc_end_sarrow, &kp END &mc_sarrow) - TAPHOLD_SYMBOL(th_sarrow, &mc_sarrow, &mc_end_sarrow) - - SYMBOL(mc_eqeq, &kp EQUAL &kp EQUAL) - SYMBOL(mc_noteq, &kp EXCL &kp EQUAL) - - SYMBOL(mc_plus, &kp PLUS) - SYMBOL(mc_end_plus, &kp END &kp PLUS) - SYMBOL(mc_2_plus, &kp PLUS &kp PLUS) - SYMBOL(mc_3_plus, &kp PLUS &kp PLUS &kp PLUS) - TAPHOLD_SYMBOL(th_plus, &mc_plus, &mc_end_plus) - TAPDANCE_SYMBOL(td_plus, &th_plus 0 0, &mc_2_plus, &mc_3_plus) - - SYMBOL(mc_eql, &kp EQUAL) - SYMBOL(mc_end_eql, &kp END &kp EQUAL) - SYMBOL(mc_2_eql, &kp EQUAL &kp EQUAL) - SYMBOL(mc_3_eql, &kp EQUAL &kp EQUAL &kp EQUAL) - TAPHOLD_SYMBOL(th_eql, &mc_eql, &mc_end_eql) - TAPDANCE_SYMBOL(td_eql, &th_eql 0 0, &mc_2_eql, &mc_3_eql) - - SYMBOL(mc_lt, &kp LT) - SYMBOL(mc_end_lt, &kp END &kp LT) - TAPHOLD_SYMBOL(th_lt, &mc_lt, &mc_end_lt) - - SYMBOL(mc_gt, &kp GT) - SYMBOL(mc_end_gt, &kp END &kp GT) - TAPHOLD_SYMBOL(th_gt, &mc_gt, &mc_end_gt) - - SYMBOL(mc_ltgt, &kp LT &kp GT) - - SYMBOL(mc_excl, &kp EXCL &sl SEN_CASE) - SYMBOL(mc_end_excl, &kp END &kp EXCL &sl SEN_CASE) - MACRO_SYMBOL(mc_throw, &kp T &kp H &kp R &kp O &kp W &kp SPACE) - TAPHOLD_SYMBOL(th_excl, &mc_excl, &mc_end_excl) - TAPDANCE_SYMBOL(td_excl, &th_excl 0 0, &mc_throw, &none) - - SYMBOL(mc_tilde, &kp TILDE &kp SPACE) - SYMBOL(mc_deg, &kp LS(LA(N8))) - SYMBOL(mc_first_o, &kp LA(N0)) - SYMBOL(mc_first_a, &kp LA(N9)) - TAPHOLD_SYMBOL(th_tilde, &mc_tilde, &mc_deg) - TAPDANCE_SYMBOL(td_tilde, &th_tilde 0 0, &mc_first_o, &mc_first_a) - - SYMBOL(mc_slash, &kp SLASH) - SYMBOL(mc_2_slash, &kp SLASH &kp SLASH) - SYMBOL(mc_3_slash, &kp SLASH &kp SLASH &kp SLASH) - SYMBOL(mc_bslash, &kp BACKSLASH) - SHIFTED_SYMBOL(mm_bslash, &mc_bslash, &mc_end_qmark) - TAPHOLD_SYMBOL(th_slash, &mc_slash, &mm_bslash) - TAPDANCE_SYMBOL(td_slash, &th_slash 0 0, &mc_2_slash, &mc_3_slash) - - SYMBOL(mc_end_ent, &kp END &kp ENTER) - SYMBOL(mc_down_end, &kp DOWN &kp END) - TAPHOLD_SYMBOL(th_end_ent, &mc_end_ent, &mc_down_end) - - MACRO_SYMBOL(mc_cancel, ¯o_tap &kp F22 &kp K_CANCEL) - MACRO_SYMBOL(mc_sentence, &kp SPACE &sl SEN_CASE &sk LSHFT) - LAYERTAP_SYMBOL(th_nsen, &mc_sentence) - LAYERTAP_SYMBOL(th_cancel, &mc_cancel) - }; + symbols { + + // Romak + + SHIFTED_SYMBOL(mm_semi, &kp SEMI, &kp COLON) + SYMBOL(mc_end_semi, &kp END &kp SEMI) + TAPHOLD_SYMBOL(th_semi, &mm_semi, &mc_end_semi) + + SYMBOL(mc_epa, ¯o_tap &kp ESC &kp P &kp J) + SYMBOL(mc_end_semi_ent, &kp END &kp SEMI &kp ENTER) + TAPHOLD_SYMBOL(th_epa, &mc_epa, &mc_end_semi_ent) + + SHIFTED_SYMBOL(mm_unds, &kp UNDERSCORE, &kp MINUS) + + SYMBOL(mc_dot, &kp DOT &sl SEN_CASE) + SYMBOL(mc_end_dot, &kp END &kp DOT &sl SEN_CASE) + TAPHOLD_SYMBOL(th_dot, &mc_dot, &mc_end_dot) + + SYMBOL(mc_comma, &kp COMMA) + SYMBOL(mc_end_comma, &kp END &kp COMMA) + TAPHOLD_SYMBOL(th_comma, &mc_comma, &mc_end_comma) + + // Lower + + SHIFTED_SYMBOL(mc_n0, &kp N0, &kp KP_N0) + SHIFTED_SYMBOL(mc_n1, &kp N1, &kp KP_N1) + SHIFTED_SYMBOL(mc_n2, &kp N2, &kp KP_N2) + SHIFTED_SYMBOL(mc_n3, &kp N3, &kp KP_N3) + SHIFTED_SYMBOL(mc_n4, &kp N4, &kp KP_N4) + SHIFTED_SYMBOL(mc_n5, &kp N5, &kp KP_N5) + SHIFTED_SYMBOL(mc_n6, &kp N6, &kp KP_N6) + SHIFTED_SYMBOL(mc_n7, &kp N7, &kp KP_N7) + SHIFTED_SYMBOL(mc_n8, &kp N8, &kp KP_N8) + SHIFTED_SYMBOL(mc_n9, &kp N9, &kp KP_N9) + + LAYERTAP_SYMBOL(th_n0, &mc_n0) + MODTAP_SYMBOL(th_n1, &mc_n1) + MODTAP_SYMBOL(th_n4, &mc_n4) + MODTAP_SYMBOL(th_n5, &mc_n5) + MODTAP_SYMBOL(th_n6, &mc_n6) + + SYMBOL(mc_lpar, &kp LPAR) + SYMBOL(mc_end_lpar, &kp END &kp LPAR) + TAPHOLD_SYMBOL(th_lpar, &mc_lpar, &mc_end_lpar) + MACRO_SYMBOL(mc_for, &kp F &kp O &kp R &kp LPAR) + TAPDANCE_SYMBOL(td_lpar, &th_lpar 0 0, &mc_for, &none) + + SYMBOL(mc_rpar, &kp RPAR) + SYMBOL(mc_end_rpar, &kp END &kp RPAR) + TAPHOLD_SYMBOL(th_rpar, &mc_rpar, &mc_end_rpar) + MACRO_SYMBOL(mc_if, &kp I &kp F &kp LPAR) + TAPDANCE_SYMBOL(td_rpar, &th_rpar 0 0, &mc_if, &none) + + SYMBOL(mc_pars, &kp LPAR &kp RPAR) + SYMBOL(mc_end_pars, &kp END &kp LPAR &kp RPAR) + TAPHOLD_SYMBOL(th_pars, &mc_pars, &mc_end_pars) + + SYMBOL(mc_bti, &kp GRAVE &kp SPACE) + + SYMBOL(mc_dqo, &kp DQT &kp SPACE) + SYMBOL(mc_end_dqo, &kp END &mc_dqo) + SYMBOL(mc_double_dqo, &mc_dqo &mc_dqo &kp LEFT) + TAPHOLD_SYMBOL(th_dqo, &mc_dqo, &mc_end_dqo) + TAPDANCE_SYMBOL(td_dqo, &th_dqo 0 0, &mc_double_dqo, &none) + + SYMBOL(mc_sqo, &kp SQT &kp SPACE) + + SYMBOL(mc_lbkt, &kp LBKT) + SYMBOL(mc_end_lbkt, &kp END &kp LBKT) + MACRO_SYMBOL(mc_switch, &kp S &kp W &kp I &kp T &kp C &kp H &kp LPAR) + TAPHOLD_SYMBOL(th_lbkt, &mc_lbkt, &mc_end_lbkt) + TAPDANCE_SYMBOL(td_lbkt, &th_lbkt 0 0, &mc_switch, &none) + + SYMBOL(mc_rbkt, &kp RBKT) + SYMBOL(mc_end_rbkt, &kp END &kp RBKT) + MACRO_SYMBOL(mc_case, &kp C &kp A &kp S &kp E &kp SPACE) + TAPHOLD_SYMBOL(th_rbkt, &mc_rbkt, &mc_end_rbkt) + TAPDANCE_SYMBOL(td_rbkt, &th_rbkt 0 0, &mc_case, &none) + + SYMBOL(mc_qmark, &kp QMARK &sl SEN_CASE) + SYMBOL(mc_end_qmark, &kp END &kp QMARK &sl SEN_CASE) + TAPHOLD_SYMBOL(th_qmark, &mc_qmark, &mc_end_qmark) + + SYMBOL(mc_and, &kp AMPS) + SYMBOL(mc_right_and, &kp RIGHT &kp AMPS &kp AMPS) + TAPHOLD_SYMBOL(th_and, &mc_and, &mc_right_and) + + SYMBOL(mc_or, &kp PIPE) + SYMBOL(mc_right_or, &kp RIGHT &kp PIPE &kp PIPE) + TAPHOLD_SYMBOL(th_or, &mc_or, &mc_right_or) + + // Raise + + SYMBOL(mc_lbrc, &kp LBRC) + SYMBOL(mc_end_lbrc, &kp END &kp LBRC) + TAPHOLD_SYMBOL(th_lbrc, &mc_lbrc, &mc_end_lbrc) + MACRO_SYMBOL(mc_var, &kp V &kp A &kp R &kp SPACE) + TAPDANCE_SYMBOL(td_lbrc, &th_lbrc 0 0, &mc_var, &none) + + SYMBOL(mc_rbrc, &kp RBRC) + SYMBOL(mc_end_rbrc, &kp END &kp RBRC) + TAPHOLD_SYMBOL(th_rbrc, &mc_rbrc, &mc_end_rbrc) + MACRO_SYMBOL(mc_return, &kp R &kp E &kp T &kp U &kp R &kp N &kp SPACE) + TAPDANCE_SYMBOL(td_rbrc, &th_rbrc 0 0, &mc_return, &none) + + SYMBOL(mc_braces, &kp END &kp LBRC &kp RBRC &kp LEFT &kp ENTER) + + SYMBOL(mc_dollar, &kp DOLLAR) + SYMBOL(mc_caret, &kp CARET &kp SPACE) + SYMBOL(mc_euro, &kp LS(LA(N2))) + TAPHOLD_SYMBOL(th_curr, &mc_caret, &mc_dollar) + TAPDANCE_SYMBOL(td_curr, &th_curr 0 0, &mc_euro, &none) + + SYMBOL(mc_colon, &kp COLON) + SYMBOL(mc_end_colon, &kp END &kp COLON) + TAPHOLD_SYMBOL(th_colon, &mc_colon, &mc_end_colon) + + SYMBOL(mc_sarrow, &kp MINUS &kp GT) + SYMBOL(mc_end_sarrow, &kp END &mc_sarrow) + TAPHOLD_SYMBOL(th_sarrow, &mc_sarrow, &mc_end_sarrow) + + SYMBOL(mc_eqeq, &kp EQUAL &kp EQUAL) + SYMBOL(mc_noteq, &kp EXCL &kp EQUAL) + + SYMBOL(mc_plus, &kp PLUS) + SYMBOL(mc_end_plus, &kp END &kp PLUS) + SYMBOL(mc_2_plus, &kp PLUS &kp PLUS) + SYMBOL(mc_3_plus, &kp PLUS &kp PLUS &kp PLUS) + TAPHOLD_SYMBOL(th_plus, &mc_plus, &mc_end_plus) + TAPDANCE_SYMBOL(td_plus, &th_plus 0 0, &mc_2_plus, &mc_3_plus) + + SYMBOL(mc_eql, &kp EQUAL) + SYMBOL(mc_end_eql, &kp END &kp EQUAL) + SYMBOL(mc_2_eql, &kp EQUAL &kp EQUAL) + SYMBOL(mc_3_eql, &kp EQUAL &kp EQUAL &kp EQUAL) + TAPHOLD_SYMBOL(th_eql, &mc_eql, &mc_end_eql) + TAPDANCE_SYMBOL(td_eql, &th_eql 0 0, &mc_2_eql, &mc_3_eql) + + SYMBOL(mc_lt, &kp LT) + SYMBOL(mc_end_lt, &kp END &kp LT) + TAPHOLD_SYMBOL(th_lt, &mc_lt, &mc_end_lt) + + SYMBOL(mc_gt, &kp GT) + SYMBOL(mc_end_gt, &kp END &kp GT) + TAPHOLD_SYMBOL(th_gt, &mc_gt, &mc_end_gt) + + SYMBOL(mc_ltgt, &kp LT &kp GT) + + SYMBOL(mc_excl, &kp EXCL &sl SEN_CASE) + SYMBOL(mc_end_excl, &kp END &kp EXCL &sl SEN_CASE) + MACRO_SYMBOL(mc_throw, &kp T &kp H &kp R &kp O &kp W &kp SPACE) + TAPHOLD_SYMBOL(th_excl, &mc_excl, &mc_end_excl) + TAPDANCE_SYMBOL(td_excl, &th_excl 0 0, &mc_throw, &none) + + SYMBOL(mc_tilde, &kp TILDE &kp SPACE) + SYMBOL(mc_deg, &kp LS(LA(N8))) + SYMBOL(mc_first_o, &kp LA(N0)) + SYMBOL(mc_first_a, &kp LA(N9)) + TAPHOLD_SYMBOL(th_tilde, &mc_tilde, &mc_deg) + TAPDANCE_SYMBOL(td_tilde, &th_tilde 0 0, &mc_first_o, &mc_first_a) + + SYMBOL(mc_slash, &kp SLASH) + SYMBOL(mc_2_slash, &kp SLASH &kp SLASH) + SYMBOL(mc_3_slash, &kp SLASH &kp SLASH &kp SLASH) + SYMBOL(mc_bslash, &kp BACKSLASH) + SHIFTED_SYMBOL(mm_bslash, &mc_bslash, &mc_end_qmark) + TAPHOLD_SYMBOL(th_slash, &mc_slash, &mm_bslash) + TAPDANCE_SYMBOL(td_slash, &th_slash 0 0, &mc_2_slash, &mc_3_slash) + + SYMBOL(mc_end_ent, &kp END &kp ENTER) + SYMBOL(mc_down_end, &kp DOWN &kp END) + TAPHOLD_SYMBOL(th_end_ent, &mc_end_ent, &mc_down_end) + }; }; diff --git a/src/zmk/config/features/thumbs.dtsi b/src/zmk/config/features/thumbs.dtsi index 2a7793bc..a3cdb60f 100644 --- a/src/zmk/config/features/thumbs.dtsi +++ b/src/zmk/config/features/thumbs.dtsi @@ -6,6 +6,28 @@ */ / { + #define THUMB_LAYERTAP(NAME, BINDINGS) \ + NAME: NAME { \ + compatible = "zmk,behavior-hold-tap"; \ + label = ZMK_MACRO_STRINGIFY(NAME); \ + #binding-cells = <2>; \ + tapping-term-ms = ; \ + flavor = "tap-preferred"; \ + quick-tap-ms = ; \ + global-quick-tap; \ + bindings = <&mo>, ; \ + }; + + #define THUMB_MACRO(NAME, BINDINGS) \ + NAME: NAME { \ + compatible = "zmk,behavior-macro"; \ + label = ZMK_MACRO_STRINGIFY(NAME); \ + #binding-cells = <0>; \ + wait-ms = <10>; \ + tap-ms = <10>; \ + bindings = <¯o_tap BINDINGS>; \ + }; + thumbs { smart_case: smart_case { compatible = "zmk,behavior-caps-word"; @@ -53,5 +75,12 @@ layers = ; continue-list = ; }; + + THUMB_MACRO(mc_cancel, &kp K_CANCEL) + THUMB_MACRO(mc_sp_ns, &kp SPACE &sl SEN_E1) + THUMB_MACRO(mc_nsen, &sl SEN_E1) + THUMB_LAYERTAP(th_sp_ns, &mc_sp_ns) + THUMB_LAYERTAP(th_cancel, &mc_cancel) + THUMB_LAYERTAP(th_nsen, &mc_nsen) }; }; \ No newline at end of file