diff options
author | Peter <peter@peterjohanson.com> | 2020-05-25 03:19:21 +0000 |
---|---|---|
committer | Peter <peter@peterjohanson.com> | 2020-05-25 03:19:21 +0000 |
commit | 96b87b2594d590b9eed009803218f773716fd2ac (patch) | |
tree | 6845d7cd69f18284ee47dc415930850ffffc6fd4 /include/dt-bindings | |
parent | ed5532bf94e93d25e35498cfd7a9040b0c69597b (diff) | |
parent | 76a433fc392be31e56df256b630a21e61775d0af (diff) |
Merge branch 'actions/mod-tap-initial-work' into 'master'
Actions: Mod-Tap initial work
See merge request zmkproject/zmk!1
Diffstat (limited to 'include/dt-bindings')
-rw-r--r-- | include/dt-bindings/zmk/keys.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/include/dt-bindings/zmk/keys.h b/include/dt-bindings/zmk/keys.h index 5a2d97a..c266de0 100644 --- a/include/dt-bindings/zmk/keys.h +++ b/include/dt-bindings/zmk/keys.h @@ -74,11 +74,23 @@ #define ZC_CSTM(n) (0xFF + n) -#define MOD_LCTL 0x00 -#define MOD_LSFT 0x01 -#define MOD_LALT 0x02 -#define MOD_LGUI 0x03 -#define MOD_RCTL 0x04 -#define MOD_RSFT 0x05 -#define MOD_RALT 0x06 -#define MOD_RGUI 0x07
\ No newline at end of file +#define MOD_LCTL (1 << 0x00) +#define MOD_LSFT (1 << 0x01) +#define MOD_LALT (1 << 0x02) +#define MOD_LGUI (1 << 0x03) +#define MOD_RCTL (1 << 0x04) +#define MOD_RSFT (1 << 0x05) +#define MOD_RALT (1 << 0x06) +#define MOD_RGUI (1 << 0x07) + +#define ZK_ACTION(k) (k >> 24) +#define _ACTION(a) (a << 24) +#define _ACTION_MODS(m) (m << 16) +#define ZK_KEY(a) (a & 0xFFFF) +#define ZK_MODS(a) ((a >> 16) & 0xFF) + +#define ZMK_ACTION_KEY 0x01 +#define ZMK_ACTION_MOD_TAP 0x01 +#define ZMK_ACTION_ONE_SHOT 0x02 + +#define MT(mods, kc) (_ACTION(ZMK_ACTION_MOD_TAP) + _ACTION_MODS(mods) + kc) |