Skip to content

Commit

Permalink
Disable Combos on BORING_LAYER
Browse files Browse the repository at this point in the history
  • Loading branch information
plodah committed Aug 22, 2024
1 parent 4b964ce commit 66e0195
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
16 changes: 16 additions & 0 deletions users/plodah/functions/combos.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,19 @@
COMBO(pl_combo_ms25, C(KC_V)),
};
#endif // ! defined(IS_MOUSE)
#ifdef PLODAH_BORING_LAYER
void plodah_layerchange_comboactions(layer_state_t state){
switch (get_highest_layer(state)) {
case PLODAH_BORING_LAYER:
if(is_combo_enabled()){
combo_disable();
}
break;
default:
if(! is_combo_enabled()){
combo_enable();
}
break;
}
}
#endif // PLODAH_BORING_LAYER
15 changes: 15 additions & 0 deletions users/plodah/plodah.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
# include "functions/combos.c"
#endif // COMBO_ENABLE

//========================//
// LAYER CHANGE //
//========================//
#if defined(PLODAH_BORING_LAYER )
layer_state_t layer_state_set_user(layer_state_t state) {
# if defined(PLODAH_BORING_LAYER )
plodah_layerchange_comboactions(state);
# endif // PLODAH_BORING_LAYER
return state;
}
#endif // PLODAH_BORING_LAYER

//==============================//
// KEYCHRON DIPSWITCH //
//==============================//
Expand All @@ -90,6 +102,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
//=======================//
// MATRIX SCAN //
//=======================//
#if (defined(PLODAH_ALTTAB_ENHANCEMENTS_ENABLE)) || ( defined(AUTOCORRECT_ENABLE) && defined(RGB_MATRIX_ENABLE) ) || (defined(PLODAH_TYPINGINDICATOR_RGBINDEX))
void matrix_scan_user(void) {
# if defined(PLODAH_ALTTAB_ENHANCEMENTS_ENABLE)
plodah_alttab_check();
Expand All @@ -101,6 +114,8 @@ void matrix_scan_user(void) {
plodah_typingindicator_check();
# endif // PLODAH_TYPINGINDICATOR_RGBINDEX
}
#endif // (defined(PLODAH_ALTTAB_ENHANCEMENTS_ENABLE)) || ( defined(AUTOCORRECT_ENABLE) && defined(RGB_MATRIX_ENABLE) ) || (defined(PLODAH_TYPINGINDICATOR_RGBINDEX))


//==========================//
// CAPS INDICATOR //
Expand Down

0 comments on commit 66e0195

Please sign in to comment.