From 0c30b49063c79be2416453f4544795922efad74f Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Fri, 22 Jan 2021 15:45:51 +0100 Subject: refactor(modifiers): define is_mods function --- app/include/zmk/keys.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/include') 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 -- cgit v1.2.3