zmk/app/include/zmk/keys.h
Peter Johanson 3a958c667f refactor: Move to zephyr/ include paths.
* Zephyr moved to properly namespaced headers, so major "rip
  the bandaid" commit to move us to those everywhere.
2023-04-05 22:55:38 -07:00

26 lines
No EOL
571 B
C

/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#include <zephyr/kernel.h>
#include <dt-bindings/zmk/keys.h>
typedef uint32_t zmk_key_t;
typedef uint8_t zmk_mod_t;
typedef uint8_t zmk_mod_flags_t;
struct zmk_key_event {
uint32_t column;
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);
}