Browse Source
* 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.xmkb
Pete Johanson
5 years ago
8 changed files with 69 additions and 22 deletions
@ -0,0 +1,5 @@
@@ -0,0 +1,5 @@
|
||||
|
||||
#include <dt-bindings/zmk/keys.h> |
||||
|
||||
#define CC_RAIS ZC_CSTM(1) |
||||
#define CC_LOWR ZC_CSTM(2) |
@ -1,7 +1,34 @@
@@ -1,7 +1,34 @@
|
||||
|
||||
#include <zmk/keys.h> |
||||
#include <zmk/keymap.h> |
||||
#include <keymap.h> |
||||
|
||||
bool zmk_handle_key_user(struct zmk_key_event *key_event) |
||||
{ |
||||
switch (key_event->key) |
||||
{ |
||||
case CC_LOWR: |
||||
if (key_event->pressed) |
||||
{ |
||||
zmk_keymap_layer_activate(1); |
||||
} |
||||
else |
||||
{ |
||||
zmk_keymap_layer_deactivate(1); |
||||
} |
||||
|
||||
return false; |
||||
case CC_RAIS: |
||||
if (key_event->pressed) |
||||
{ |
||||
zmk_keymap_layer_activate(2); |
||||
} |
||||
else |
||||
{ |
||||
zmk_keymap_layer_deactivate(2); |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
return true; |
||||
}; |
||||
|
Loading…
Reference in new issue