diff --git a/src/main.c b/src/main.c index 7c2df9e..6af6d98 100644 --- a/src/main.c +++ b/src/main.c @@ -22,6 +22,8 @@ // types and forward declarations // -------------------------------------------------------------------- +#define array_length(x) (sizeof(x) / sizeof((x)[0])) + typedef uint8_t u8; typedef uint16_t u16; @@ -71,6 +73,15 @@ static bool layer_sticky_done; static u8 mod_sticky; static bool mod_sticky_done; +static const keyfunc _kb_layer_funcs[] = { // TODO ugh + &kbfun_layer_press_release, + &kbfun_layer_sticky, + &kbfun_shift_layer_press_release, + &kbfun_control_layer_press_release, + &kbfun_alt_layer_press_release, + &kbfun_win_layer_press_release, +}; + // ---------------------------------------------------------------------------- int main() { @@ -215,8 +226,10 @@ void layer_disable(layer l) { } bool is_layer_keyfunc(keyfunc f) { - if (f == &kbfun_layer_press_release || f == &kbfun_layer_sticky) { - return true; + for (int i=0; i