summaryrefslogtreecommitdiff
path: root/app/include
diff options
context:
space:
mode:
authorOkke Formsma <okke@formsma.nl>2021-01-22 15:45:51 +0100
committerPete Johanson <peter@peterjohanson.com>2021-01-24 23:30:41 -0500
commit0c30b49063c79be2416453f4544795922efad74f (patch)
treee6b7d5524e6d4f88af54c54198e4c8085c8e32b7 /app/include
parentdf4a5c8613365a8ee292dedaf345f76c196e4858 (diff)
refactor(modifiers): define is_mods function
Diffstat (limited to 'app/include')
-rw-r--r--app/include/zmk/keys.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/include/zmk/keys.h b/app/include/zmk/keys.h
index 62e3cce..38777ec 100644
--- a/app/include/zmk/keys.h
+++ b/app/include/zmk/keys.h
@@ -18,4 +18,9 @@ struct zmk_key_event {
uint32_t row;
zmk_key_t key;
bool pressed;
-}; \ No newline at end of file
+};
+
+static inline bool is_mod(uint8_t usage_page, uint32_t keycode) {
+ return (keycode >= HID_USAGE_KEY_KEYBOARD_LEFTCONTROL &&
+ keycode <= HID_USAGE_KEY_KEYBOARD_RIGHT_GUI && usage_page == HID_USAGE_KEY);
+} \ No newline at end of file