From 223edf05ad08938b066f9187668ebfae43c5e91a Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Sun, 21 Jun 2020 21:43:44 -0400 Subject: Refactor global bindings, implement mod-tap. * Use extra comptible = "zmk,behavior-global" to add behaviors to global bindings for event notification. * Implement mod-tap, as a keymap binding and global one to skip tap if other keycode pressed while held. --- app/include/zmk/events.h | 6 ++++-- app/include/zmk/keymap.h | 8 -------- app/include/zmk/matrix.h | 2 ++ 3 files changed, 6 insertions(+), 10 deletions(-) (limited to 'app/include/zmk') diff --git a/app/include/zmk/events.h b/app/include/zmk/events.h index ac4815a..8d1ae6a 100644 --- a/app/include/zmk/events.h +++ b/app/include/zmk/events.h @@ -1,11 +1,13 @@ #pragma once +#include + int zmk_events_position_pressed(u32_t position); int zmk_events_position_released(u32_t position); int zmk_events_keycode_pressed(u32_t keycode); int zmk_events_keycode_released(u32_t keycode); -int zmk_events_mod_pressed(u32_t modifier); -int zmk_events_mod_released(u32_t modifier); +int zmk_events_modifiers_pressed(zmk_mod_flags modifiers); +int zmk_events_modifiers_released(zmk_mod_flags modifiers); int zmk_events_consumer_key_pressed(u32_t usage); int zmk_events_consumer_key_released(u32_t usage); diff --git a/app/include/zmk/keymap.h b/app/include/zmk/keymap.h index cf38904..38c1249 100644 --- a/app/include/zmk/keymap.h +++ b/app/include/zmk/keymap.h @@ -1,13 +1,5 @@ #pragma once -#include -#include -#include -#include - -#include -// #include - bool zmk_keymap_layer_activate(u8_t layer); bool zmk_keymap_layer_deactivate(u8_t layer); diff --git a/app/include/zmk/matrix.h b/app/include/zmk/matrix.h index 783c98e..9cabb7e 100644 --- a/app/include/zmk/matrix.h +++ b/app/include/zmk/matrix.h @@ -1,5 +1,7 @@ #pragma once +#include + #define ZMK_MATRIX_NODE_ID DT_CHOSEN(zmk_kscan) #if DT_NODE_HAS_PROP(ZMK_MATRIX_NODE_ID,row_gpios) -- cgit v1.2.3