diff --git a/users/t4corun/config/combo_config.h b/users/t4corun/config/combo_config.h index c26fc48b..033e2d1d 100644 --- a/users/t4corun/config/combo_config.h +++ b/users/t4corun/config/combo_config.h @@ -9,27 +9,30 @@ Explore these (there are way more) */ //Clear variables we plan to use that might be set elsewhere +#undef COMBO_ONLY_FROM_LAYER +#undef EXTRA_SHORT_COMBOS + #undef COMBO_TERM #undef COMBO_TERM_PER_COMBO -#undef COMBO_MUST_TAP_PER_COMBO -#undef EXTRA_SHORT_COMBOS -#undef COMBO_ONLY_FROM_LAYER #undef COMBO_HOLD_TERM #undef COMBO_MUST_HOLD_PER_COMBO +#undef COMBO_MUST_TAP_PER_COMBO #undef COMBO_MUST_PRESS_IN_ORDER_PER_COMBO - +#undef COMBO_SHOULD_TRIGGER //Set common configuration for all keyboards +#define COMBO_ONLY_FROM_LAYER 0 //this will always setup combos based off of QWERTY layout +#define EXTRA_SHORT_COMBOS + #define COMBO_TERM 35 #define COMBO_TERM_PER_COMBO -#define COMBO_MUST_TAP_PER_COMBO -#define EXTRA_SHORT_COMBOS -#define COMBO_ONLY_FROM_LAYER 0 //this will always setup combos based off of QWERTY #define COMBO_HOLD_TERM TAPPING_TERM #define COMBO_MUST_HOLD_PER_COMBO -#define COMBO_MUST_PRESS_IN_ORDER_PER_COMBO \ No newline at end of file +#define COMBO_MUST_TAP_PER_COMBO +#define COMBO_MUST_PRESS_IN_ORDER_PER_COMBO +#define COMBO_SHOULD_TRIGGER \ No newline at end of file diff --git a/users/t4corun/features/combo.c b/users/t4corun/features/combo.c index 4cdb78e0..598590f0 100644 --- a/users/t4corun/features/combo.c +++ b/users/t4corun/features/combo.c @@ -1,14 +1,16 @@ #include "combo.h" -bool get_combo_must_hold(uint16_t index, combo_t *combo) { +uint16_t get_combo_term(uint16_t index, combo_t *combo) { + // or with combo index, i.e. its name from enum. switch (index) { - - case LYR_CONFIG: - case LYR_FUNCTION: - return true; - + /* + case CONFIGLAYER: + return COMBO_HOLD_TERM + 150; + */ + default: - return false; + return COMBO_TERM; + } } @@ -23,6 +25,8 @@ bool get_combo_must_tap(uint16_t index, combo_t *combo) { case MOUSE_DRGTOG: #endif //MOUSEKEY_ENABLE + case KEY_ESC: + case KEY_ENT: case KEY_TAB: case KEY_BWRD: return true; @@ -32,6 +36,18 @@ bool get_combo_must_tap(uint16_t index, combo_t *combo) { } } +bool get_combo_must_hold(uint16_t index, combo_t *combo) { + switch (index) { + + case LYR_CONFIG: + case LYR_FUNCTION: + return true; + + default: + return false; + } +} + bool get_combo_must_press_in_order(uint16_t combo_index, combo_t *combo) { switch (combo_index) { /* List combos here that you want to only activate if their keys @@ -41,28 +57,42 @@ bool get_combo_must_press_in_order(uint16_t combo_index, combo_t *combo) { * return false means they do not have to be pressed in order * */ -#if defined(MOUSEKEY_ENABLE2222) - case MOUSE_BUTTON1: - case MOUSE_BUTTON2: - case MOUSE_BUTTON4: - return true; -#endif //MOUSEKEY_ENABLE - default: return false; } } -uint16_t get_combo_term(uint16_t index, combo_t *combo) { - // or with combo index, i.e. its name from enum. - switch (index) { - /* - case CONFIGLAYER: - return COMBO_HOLD_TERM + 150; - */ - - default: - return COMBO_TERM; +bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record) { - } + // disable all combos on config layer + if ( get_highest_layer(layer_state) == _CONFIG ) { + return false; + } + + switch (combo_index) { + + case KEY_ESC: + case KEY_ENT: + case KEY_TAB: + if ( get_highest_layer(layer_state) == _NAVIGATION || + get_highest_layer(layer_state) == _SYMBOL ) { + return false; + } + break; + + case MOUSE_BUTTON1: + case MOUSE_BUTTON2: + case MOUSE_BUTTON3: + case MOUSE_BUTTON4: + case MOUSE_BUTTON5: + case MOUSE_DRGTOG: + if ( get_highest_layer(layer_state) == _NAVIGATION || + get_highest_layer(layer_state) == _NUMBER || + get_highest_layer(layer_state) == _SYMBOL ) { + return false; + } + break; + } + + return true; } \ No newline at end of file diff --git a/users/t4corun/features/combo.h b/users/t4corun/features/combo.h index 1b219016..95214280 100644 --- a/users/t4corun/features/combo.h +++ b/users/t4corun/features/combo.h @@ -13,10 +13,12 @@ enum combos { MOUSE_DRGTOG, #endif //MOUSEKEY_ENABLE - KEY_TAB, + KEY_ESC, + KEY_ENT, LYR_FUNCTION, // right hand combos + KEY_TAB, KEY_DEL, KEY_BSPC, KEY_BWRD, @@ -29,23 +31,27 @@ enum combos { // left hand combos #if defined(MOUSEKEY_ENABLE) const uint16_t PROGMEM mou_btn1_combo[] = { KC_D, KC_F, COMBO_END }; -const uint16_t PROGMEM mou_btn2_combo[] = { KC_S, KC_D, COMBO_END }; +const uint16_t PROGMEM mou_btn2_combo[] = { KC_C, KC_V, COMBO_END }; const uint16_t PROGMEM mou_btn3_combo[] = { KC_S, KC_D, KC_F, COMBO_END }; const uint16_t PROGMEM mou_btn4_combo[] = { KC_E, KC_R, COMBO_END }; -const uint16_t PROGMEM mou_btn5_combo[] = { KC_W, KC_E, COMBO_END }; -const uint16_t PROGMEM mou_drg_combo[] = { TR_MOUA, KC_S, KC_D, KC_F, COMBO_END }; +const uint16_t PROGMEM mou_btn5_combo[] = { KC_W, KC_E, KC_R, COMBO_END }; +const uint16_t PROGMEM mou_drg_combo[] = { KC_A, KC_S, KC_D, KC_F, COMBO_END }; #endif //MOUSEKEY_ENABLE -const uint16_t PROGMEM key_tab_combo[] = { KC_C, KC_V, COMBO_END }; +const uint16_t PROGMEM key_esc_combo[] = { KC_W, KC_E, COMBO_END }; +const uint16_t PROGMEM key_ent_combo[] = { KC_X, KC_C, COMBO_END }; const uint16_t PROGMEM lyr_fun_combo[] = { NUM, TR_LSFT, COMBO_END }; + // right hand combos +const uint16_t PROGMEM key_tab_combo[] = { KC_J, KC_K, COMBO_END }; const uint16_t PROGMEM key_del_combo[] = { TR_COMM, TR_DOT, COMBO_END }; const uint16_t PROGMEM key_bspc_combo[] = { KC_M, TR_COMM, COMBO_END }; const uint16_t PROGMEM key_bwrd_combo[] = { KC_M, TR_DOT, COMBO_END }; const uint16_t PROGMEM lyr_cfg_combo[] = { KC_SPC, NAV, COMBO_END }; + combo_t key_combos[COMBO_LENGTH] = { // left hand combos @@ -58,10 +64,12 @@ combo_t key_combos[COMBO_LENGTH] = { [MOUSE_DRGTOG] = COMBO(mou_drg_combo, TR_DRGS), #endif //MOUSEKEY_ENABLE - [KEY_TAB] = COMBO(key_tab_combo, KC_TAB), + [KEY_ESC] = COMBO(key_esc_combo, KC_ESC), + [KEY_ENT] = COMBO(key_ent_combo, KC_ENT), [LYR_FUNCTION] = COMBO(lyr_fun_combo, FUNC), // right hand combos + [KEY_TAB] = COMBO(key_tab_combo, KC_TAB), [KEY_DEL] = COMBO(key_del_combo, KC_DEL), [KEY_BSPC] = COMBO(key_bspc_combo, KC_BSPC), [KEY_BWRD] = COMBO(key_bwrd_combo, BACKWRD), diff --git a/users/t4corun/t4corun.h b/users/t4corun/t4corun.h index f57c469e..6460e08d 100644 --- a/users/t4corun/t4corun.h +++ b/users/t4corun/t4corun.h @@ -12,8 +12,6 @@ enum layers { _NUMBER, _SYMBOL, _FUNCTION, - _MOUSE, - _GAME_NUM, _CONFIG }; @@ -46,8 +44,6 @@ enum keycodes { #define NAV MO(_NAVIGATION) #define NAV_0 LT(_NAVIGATION, KC_0) #define NUM MO(_NUMBER) -#define CONFIG MO(_CONFIG) -#define FUNC MO(_FUNCTION) // Windows Shortcuts #define SC_COPY LCTL(KC_C) @@ -100,7 +96,6 @@ enum keycodes { #if defined(MOUSEKEY_ENABLE) -# define TR_MOUA LT(_MOUSE, KC_A) # define TR_MOUU KC_MS_U # define TR_MOUD KC_MS_D @@ -130,7 +125,6 @@ enum keycodes { # endif //KEYBOARD_bastardkb_charybdis_3x5 #else -# define TR_MOUA KC_A # define TR_MOUU ___x___ # define TR_MOUD ___x___ @@ -205,14 +199,14 @@ enum keycodes { #define LAYER_QWERTY \ KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ - TR_MOUA, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TR_QUOT, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TR_QUOT, \ KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, TR_COMM, TR_DOT, TR_MINS, \ _BASE_L4_________________, _BASE_R4_________________ #define LAYER_COLEMAK_DH \ KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, TR_QUOT, \ - TR_MOUA, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, \ + KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, \ KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, TR_COMM, TR_DOT, TR_MINS, \ _BASE_L4_________________, _BASE_R4_________________ @@ -232,14 +226,14 @@ enum keycodes { #define LAYER_NUMBER \ - KC_ESC, SC_SNIP, SC_FILE, ___x___, TR_GRV, ___x___, KC_7, KC_8, KC_9, ___x___, \ + ___x___, SC_SNIP, SC_FILE, ___x___, TR_GRV, ___x___, KC_7, KC_8, KC_9, ___x___, \ _GACS_MODS________________________, TR_SCLN, ___x___, KC_4, KC_5, KC_6, KC_DOT, \ _UCCPR_L___________________________________, ___x___, KC_1, KC_2, KC_3, TR_MINS, \ _LAYER_TRANS_____________, KC_SPC, NAV_0, ___x___ #define LAYER_SYMBOL \ - KC_ESC, ___x___, KC_AT, KC_DLR, TR_GRV, TR_EQL, KC_HASH, KC_ASTR, ___x___, TR_DQUO, \ + ___x___, ___x___, KC_AT, KC_DLR, TR_GRV, TR_EQL, KC_HASH, KC_ASTR, ___x___, TR_DQUO, \ KC_AMPR, TR_LCBR, KC_RCBR, KC_PIPE, TR_SCLN, ___x___, KC_QUES, TR_LBRC, KC_RBRC, TR_SQUO, \ TR_PERC, TR_LABK, KC_RABK, KC_BSLS, KC_EXLM, ___x___, KC_SLSH, TR_LPRN, TR_DOT, TR_MINS, \ _LAYER_TRANS_____________, _LAYER_TRANS_____________