refactor(modifiers): define is_mods function

This commit is contained in:
Okke Formsma
2021-01-22 15:45:51 +01:00
committed by Pete Johanson
parent df4a5c8613
commit 0c30b49063
2 changed files with 8 additions and 9 deletions

View File

@@ -18,4 +18,9 @@ struct zmk_key_event {
uint32_t row;
zmk_key_t key;
bool pressed;
};
};
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);
}