summaryrefslogtreecommitdiff
path: root/include/zmk/keymap.h
diff options
context:
space:
mode:
authorPete Johanson <peter@peterjohanson.com>2020-05-18 13:42:41 -0400
committerPete Johanson <peter@peterjohanson.com>2020-05-18 13:42:41 -0400
commitf478438f01e081514f255ce67f7b75935ee7b51a (patch)
tree22595d1f285d5937af3f93cc752ff2feee5e26fd /include/zmk/keymap.h
parentc1905745b3578037d1791bd634a3d1607cafd525 (diff)
Implement raise/lower for default keymap.
* Properly allow includes for keymaps to allow defining custom keycodes, and then adding them to the keymap.overlay file. * Fix keymap.c loading after build refactor. * Fix for deactivating a layer working properly. * Fix default keymap to put transparent in proper spots to make raise/lower keycodes work as expected. * Add custom raise/lower keycode handling to default keymap.
Diffstat (limited to 'include/zmk/keymap.h')
-rw-r--r--include/zmk/keymap.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/zmk/keymap.h b/include/zmk/keymap.h
index 9b58cc0..e575774 100644
--- a/include/zmk/keymap.h
+++ b/include/zmk/keymap.h
@@ -11,6 +11,16 @@
#define ZMK_KEYMAP_NODE DT_CHOSEN(zmk_keymap)
#define ZMK_KEYMAP_LAYERS_LEN DT_PROP_LEN(ZMK_KEYMAP_NODE, layers)
+#define _ZMK_LAYER_ENUM_ITEM(label) DT_CAT(label, _layer)
+
+#define _ZMK_KEYMAP_GENERATE_LAYER_CONST(node_id) \
+ _ZMK_LAYER_ENUM_ITEM(DT_NODELABEL(node_id)),
+
+enum zmk_keymap_layer
+{
+ DT_FOREACH_CHILD(DT_INST(0, zmk_layers), _ZMK_KEYMAP_GENERATE_LAYER_CONST)
+};
+
bool zmk_keymap_layer_activate(u8_t layer);
bool zmk_keymap_layer_deactivate(u8_t layer);