forked from kofal.net/zmk
Fix consumer keys w/ refactored behaviors.
This commit is contained in:
@@ -4,5 +4,4 @@
|
||||
#include <zmk/hid.h>
|
||||
|
||||
int zmk_endpoints_init();
|
||||
int zmk_endpoints_send_report(enum zmk_hid_report_changes changes);
|
||||
int zmk_endpoints_send_key_event(struct zmk_key_event key_event);
|
||||
int zmk_endpoints_send_report(u8_t usage_report);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
int zmk_events_position_pressed(u32_t position);
|
||||
int zmk_events_position_released(u32_t position);
|
||||
int zmk_events_keycode_pressed(u32_t keycode);
|
||||
int zmk_events_keycode_released(u32_t keycode);
|
||||
int zmk_events_keycode_pressed(u8_t usage_page, u32_t keycode);
|
||||
int zmk_events_keycode_released(u8_t usage_page, u32_t keycode);
|
||||
int zmk_events_modifiers_pressed(zmk_mod_flags modifiers);
|
||||
int zmk_events_modifiers_released(zmk_mod_flags modifiers);
|
||||
int zmk_events_consumer_key_pressed(u32_t usage);
|
||||
|
||||
@@ -108,40 +108,21 @@ static const u8_t zmk_hid_report_desc[] = {
|
||||
0x00,
|
||||
/* LOGICAL_MAXIMUM (1) */
|
||||
HID_GI_LOGICAL_MAX(1),
|
||||
0x01,
|
||||
/* USAGE (Scan Next Track) */
|
||||
HID_LI_USAGE,
|
||||
0xB5,
|
||||
/* USAGE (Scan Previous Track) */
|
||||
HID_LI_USAGE,
|
||||
0xB6,
|
||||
/* USAGE (Stop) */
|
||||
HID_LI_USAGE,
|
||||
0xB7,
|
||||
/* USAGE (Eject) */
|
||||
HID_LI_USAGE,
|
||||
0xB8,
|
||||
/* USAGE (Media Play/Pause) */
|
||||
HID_LI_USAGE,
|
||||
0xCD,
|
||||
/* USAGE (Mute) */
|
||||
HID_LI_USAGE,
|
||||
0xE2,
|
||||
/* USAGE (Volume Increment) */
|
||||
HID_LI_USAGE,
|
||||
0xE9,
|
||||
/* USAGE (Volume Decrement) */
|
||||
HID_LI_USAGE,
|
||||
0xEA,
|
||||
0xFF,
|
||||
HID_LI_USAGE_MIN(1),
|
||||
0x00,
|
||||
/* USAGE_MAXIMUM (Keyboard Application) */
|
||||
HID_LI_USAGE_MAX(1),
|
||||
0xFF,
|
||||
/* INPUT (Data,Ary,Abs) */
|
||||
/* REPORT_SIZE (1) */
|
||||
/* REPORT_SIZE (8) */
|
||||
HID_GI_REPORT_SIZE,
|
||||
0x01,
|
||||
0x08,
|
||||
/* REPORT_COUNT (8) */
|
||||
HID_GI_REPORT_COUNT,
|
||||
0x08,
|
||||
0x06,
|
||||
HID_MI_INPUT,
|
||||
0x02,
|
||||
0x00,
|
||||
/* END COLLECTION */
|
||||
HID_MI_COLLECTION_END,
|
||||
};
|
||||
@@ -167,7 +148,7 @@ struct zmk_hid_keypad_report
|
||||
|
||||
struct zmk_hid_consumer_report_body
|
||||
{
|
||||
u8_t keys;
|
||||
u8_t keys[6];
|
||||
} __packed;
|
||||
|
||||
struct zmk_hid_consumer_report
|
||||
@@ -176,19 +157,15 @@ struct zmk_hid_consumer_report
|
||||
struct zmk_hid_consumer_report_body body;
|
||||
} __packed;
|
||||
|
||||
enum zmk_hid_report_changes
|
||||
{
|
||||
None = 0x00,
|
||||
Keypad = (0x01 << 0x00),
|
||||
Consumer = (0x01 << 0x01)
|
||||
};
|
||||
|
||||
int zmk_hid_register_mod(zmk_mod modifier);
|
||||
int zmk_hid_unregister_mod(zmk_mod modifier);
|
||||
int zmk_hid_register_mods(zmk_mod_flags modifiers);
|
||||
int zmk_hid_unregister_mods(zmk_mod_flags modifiers);
|
||||
enum zmk_hid_report_changes zmk_hid_press_key(zmk_key key);
|
||||
enum zmk_hid_report_changes zmk_hid_release_key(zmk_key key);
|
||||
int zmk_hid_keypad_press(zmk_key key);
|
||||
int zmk_hid_keypad_release(zmk_key key);
|
||||
|
||||
int zmk_hid_consumer_press(zmk_key key);
|
||||
int zmk_hid_consumer_release(zmk_key key);
|
||||
|
||||
struct zmk_hid_keypad_report *zmk_hid_get_keypad_report();
|
||||
struct zmk_hid_consumer_report *zmk_hid_get_consumer_report();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
bool zmk_keymap_layer_activate(u8_t layer);
|
||||
bool zmk_keymap_layer_deactivate(u8_t layer);
|
||||
int zmk_keymap_layer_activate(u8_t layer);
|
||||
int zmk_keymap_layer_deactivate(u8_t layer);
|
||||
|
||||
int zmk_keymap_position_state_changed(u32_t position, bool pressed);
|
||||
|
||||
Reference in New Issue
Block a user