Browse Source

refactor(app): Replace `HID_EXT_USAGE` with `HID_USAGE`

Simplifies terminology and improves readability.
xmkb
innovaker 4 years ago
parent
commit
c21897856b
  1. 6
      app/include/dt-bindings/zmk/hid_usage_pages.h
  2. 755
      app/include/dt-bindings/zmk/keys.h
  3. 4
      app/include/zmk/events/keycode-state-changed.h

6
app/include/dt-bindings/zmk/hid_usage_pages.h

@ -10,9 +10,9 @@
#pragma once #pragma once
#define HID_EXT_USAGE(page, id) ((page << 16) | id) #define HID_USAGE(page, id) ((page << 16) | id)
#define HID_EXT_USAGE_ID(ext) (ext & 0xFFFF) #define HID_USAGE_ID(usage) (usage & 0xFFFF)
#define HID_EXT_USAGE_PAGE(ext) (ext >> 16) #define HID_USAGE_PAGE(usage) (usage >> 16)
/* WARNING: DEPRECATED from dt-bindings/zmk/keys.h */ /* WARNING: DEPRECATED from dt-bindings/zmk/keys.h */
#define USAGE_KEYPAD (0x07) // WARNING: DEPRECATED (DO NOT USE) #define USAGE_KEYPAD (0x07) // WARNING: DEPRECATED (DO NOT USE)

755
app/include/dt-bindings/zmk/keys.h

File diff suppressed because it is too large Load Diff

4
app/include/zmk/events/keycode-state-changed.h

@ -24,8 +24,8 @@ ZMK_EVENT_DECLARE(keycode_state_changed);
static inline struct keycode_state_changed *keycode_state_changed_from_encoded(u32_t encoded, static inline struct keycode_state_changed *keycode_state_changed_from_encoded(u32_t encoded,
bool pressed) { bool pressed) {
u16_t page = HID_EXT_USAGE_PAGE(encoded) & 0xFF; u16_t page = HID_USAGE_PAGE(encoded) & 0xFF;
u16_t id = HID_EXT_USAGE_ID(encoded); u16_t id = HID_USAGE_ID(encoded);
zmk_mod_flags implicit_mods = SELECT_MODS(encoded); zmk_mod_flags implicit_mods = SELECT_MODS(encoded);
if (!page) { if (!page) {

Loading…
Cancel
Save