refactor(app): replace zmk_key with zmk_key_t
Aligns with typedef _t convention. PR: #531
This commit is contained in:
parent
4fc17e0b3a
commit
87179698b4
4 changed files with 11 additions and 11 deletions
|
@ -170,12 +170,12 @@ int zmk_hid_register_mod(zmk_mod modifier);
|
|||
int zmk_hid_unregister_mod(zmk_mod modifier);
|
||||
int zmk_hid_implicit_modifiers_press(zmk_mod_flags implicit_modifiers);
|
||||
int zmk_hid_implicit_modifiers_release();
|
||||
int zmk_hid_keyboard_press(zmk_key key);
|
||||
int zmk_hid_keyboard_release(zmk_key key);
|
||||
int zmk_hid_keyboard_press(zmk_key_t key);
|
||||
int zmk_hid_keyboard_release(zmk_key_t key);
|
||||
void zmk_hid_keyboard_clear();
|
||||
|
||||
int zmk_hid_consumer_press(zmk_key key);
|
||||
int zmk_hid_consumer_release(zmk_key key);
|
||||
int zmk_hid_consumer_press(zmk_key_t key);
|
||||
int zmk_hid_consumer_release(zmk_key_t key);
|
||||
void zmk_hid_consumer_clear();
|
||||
|
||||
struct zmk_hid_keyboard_report *zmk_hid_get_keyboard_report();
|
||||
|
|
|
@ -9,13 +9,13 @@
|
|||
#include <zephyr.h>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
|
||||
typedef uint32_t zmk_key;
|
||||
typedef uint32_t zmk_key_t;
|
||||
typedef uint8_t zmk_mod;
|
||||
typedef uint8_t zmk_mod_flags;
|
||||
|
||||
struct zmk_key_event {
|
||||
uint32_t column;
|
||||
uint32_t row;
|
||||
zmk_key key;
|
||||
zmk_key_t key;
|
||||
bool pressed;
|
||||
};
|
|
@ -596,7 +596,7 @@ int zmk_ble_unpair_all() {
|
|||
};
|
||||
|
||||
bool zmk_ble_handle_key_user(struct zmk_key_event *key_event) {
|
||||
zmk_key key = key_event->key;
|
||||
zmk_key_t key = key_event->key;
|
||||
|
||||
if (!auth_passkey_entry_conn) {
|
||||
return true;
|
||||
|
|
|
@ -77,7 +77,7 @@ int zmk_hid_implicit_modifiers_release() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int zmk_hid_keyboard_press(zmk_key code) {
|
||||
int zmk_hid_keyboard_press(zmk_key_t code) {
|
||||
if (code >= HID_USAGE_KEY_KEYBOARD_LEFTCONTROL && code <= HID_USAGE_KEY_KEYBOARD_RIGHT_GUI) {
|
||||
return zmk_hid_register_mod(code - HID_USAGE_KEY_KEYBOARD_LEFTCONTROL);
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ int zmk_hid_keyboard_press(zmk_key code) {
|
|||
return 0;
|
||||
};
|
||||
|
||||
int zmk_hid_keyboard_release(zmk_key code) {
|
||||
int zmk_hid_keyboard_release(zmk_key_t code) {
|
||||
if (code >= HID_USAGE_KEY_KEYBOARD_LEFTCONTROL && code <= HID_USAGE_KEY_KEYBOARD_RIGHT_GUI) {
|
||||
return zmk_hid_unregister_mod(code - HID_USAGE_KEY_KEYBOARD_LEFTCONTROL);
|
||||
}
|
||||
|
@ -95,12 +95,12 @@ int zmk_hid_keyboard_release(zmk_key code) {
|
|||
|
||||
void zmk_hid_keyboard_clear() { memset(&keyboard_report.body, 0, sizeof(keyboard_report.body)); }
|
||||
|
||||
int zmk_hid_consumer_press(zmk_key code) {
|
||||
int zmk_hid_consumer_press(zmk_key_t code) {
|
||||
TOGGLE_CONSUMER(0U, code);
|
||||
return 0;
|
||||
};
|
||||
|
||||
int zmk_hid_consumer_release(zmk_key code) {
|
||||
int zmk_hid_consumer_release(zmk_key_t code) {
|
||||
TOGGLE_CONSUMER(code, 0U);
|
||||
return 0;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue