cleanup and tuning

- added escape and enter back in
- made the mouse buttons more intuitive
- moved tab to the right hand
- implemented combos per layer
This commit is contained in:
Victor 2024-04-18 20:41:02 -05:00
parent f9aa0c3866
commit 567bbb7d25
Failed to generate hash of commit
4 changed files with 84 additions and 49 deletions

View file

@ -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;
}