From 11b79bcc8cdd718397ebc0ac452392c898c7db9b Mon Sep 17 00:00:00 2001 From: Stefan Dorn Date: Wed, 20 Jul 2016 21:53:26 +0100 Subject: [PATCH] combo with layers --- src/main.c | 40 +++++++++++++++++++++++++++++++++------- src/main.h | 11 ++++++++--- 2 files changed, 41 insertions(+), 10 deletions(-) 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