Merge pull request #352 from innovaker/refactor-hid-ext-usage
refactor(app): Replace `HID_EXT_USAGE` with `HID_USAGE`
This commit is contained in:
commit
b091c7ed3b
3 changed files with 376 additions and 389 deletions
|
@ -10,9 +10,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#define HID_EXT_USAGE(page, id) ((page << 16) | id)
|
||||
#define HID_EXT_USAGE_ID(ext) (ext & 0xFFFF)
|
||||
#define HID_EXT_USAGE_PAGE(ext) (ext >> 16)
|
||||
#define HID_USAGE(page, id) ((page << 16) | id)
|
||||
#define HID_USAGE_ID(usage) (usage & 0xFFFF)
|
||||
#define HID_USAGE_PAGE(usage) (usage >> 16)
|
||||
|
||||
/* WARNING: DEPRECATED from dt-bindings/zmk/keys.h */
|
||||
#define USAGE_KEYPAD (0x07) // WARNING: DEPRECATED (DO NOT USE)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -24,8 +24,8 @@ ZMK_EVENT_DECLARE(keycode_state_changed);
|
|||
|
||||
static inline struct keycode_state_changed *keycode_state_changed_from_encoded(u32_t encoded,
|
||||
bool pressed) {
|
||||
u16_t page = HID_EXT_USAGE_PAGE(encoded) & 0xFF;
|
||||
u16_t id = HID_EXT_USAGE_ID(encoded);
|
||||
u16_t page = HID_USAGE_PAGE(encoded) & 0xFF;
|
||||
u16_t id = HID_USAGE_ID(encoded);
|
||||
zmk_mod_flags implicit_mods = SELECT_MODS(encoded);
|
||||
|
||||
if (!page) {
|
||||
|
|
Loading…
Reference in a new issue