zmk_mf68/app/boards/shields/petejohanson_proton_handwire/keymap/keymap.c
Pete Johanson 583839afce Initial refactor to have a shield/board have one default keymap.
* Start of work of focusing on out-of-tree user keymaps.

Add ZMK_CONFIG support.

* General external configuration supported via ZMK_CONFIG,
  which should point to a configuration directory.
* Priority order of overlay files to select.
  * ${SHIELD}_${BOARD}.overlay
  * ${SHIELD}.overlay
  * ${BOARD}.overlay
  * default.overlay
* Equivalent search order for .conf files for initial Kconfig
  values.
2020-06-14 23:58:43 -04:00

34 lines
490 B
C

#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(LOWER);
}
else
{
zmk_keymap_layer_deactivate(LOWER);
}
return false;
case CC_RAIS:
if (key_event->pressed)
{
zmk_keymap_layer_activate(RAISE);
}
else
{
zmk_keymap_layer_deactivate(RAISE);
}
return false;
}
return true;
};