From 994e5b2291b2e592b1291a68d5e94d3613c72da2 Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 20 Dec 2021 14:15:45 +0000 Subject: some docs / comments --- keymap-wrapper.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'keymap-wrapper.h') diff --git a/keymap-wrapper.h b/keymap-wrapper.h index 87326ca..9418ebb 100644 --- a/keymap-wrapper.h +++ b/keymap-wrapper.h @@ -4,6 +4,23 @@ #include "Kaleidoscope-MouseKeys.h" #include "keymap-layers.h" +/* hack hack hack! + + for each layer, we need 2 arrays: one for the keys, one for the + colours. But we want to defined each key next to its + colour. Therefore we write our keymap using the CK and ColorKeymaps + macros, and include this file. + + First, we define CK as "return the first argument (the key)", and + ColorKeymaps as "a klaeidoscope keymap", and include our keymaps + definition. + + Then, we *redefine* CK as "return the second argument (the colour)" + and ColorKeymaps as "a DakkarColor color map", and include our + keymaps definition *again* (make sure you don't add a `#pragma + "once"` in there!) + */ + #define CK(k,c) k #define ColorKeymaps(layers...) KEYMAPS(layers) -- cgit v1.2.3