summaryrefslogtreecommitdiff
path: root/app/include/zmk/keys.h
diff options
context:
space:
mode:
Diffstat (limited to 'app/include/zmk/keys.h')
-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