e056a113a2
- 将发送 HID 按键的逻辑提取到 send_hid_combo_or_warn 函数中 - 更新 on_boot_press 函数以使用新的发送逻辑 - 在按钮点击事件处理函数中调用 send_hid_combo_or_warn,简化代码并增强可读性
28 lines
664 B
C
28 lines
664 B
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#define HID_MOD_LCTRL 0x01
|
|
#define HID_MOD_LSHIFT 0x02
|
|
#define HID_MOD_LALT 0x04
|
|
#define HID_MOD_LGUI 0x08
|
|
|
|
#define HID_KEY_C 0x06
|
|
#define HID_KEY_V 0x19
|
|
#define HID_KEY_X 0x1B
|
|
#define HID_KEY_F5 0x3E
|
|
|
|
typedef void (*ble_hid_status_cb_t)(bool connected);
|
|
|
|
int ble_hid_init(ble_hid_status_cb_t status_cb);
|
|
bool ble_hid_ready(void);
|
|
|
|
int ble_hid_key_press(uint8_t modifier, uint8_t keycode);
|
|
int ble_hid_key_release(void);
|
|
int ble_hid_send_combo(uint8_t modifier, uint8_t keycode);
|
|
|
|
#if defined(BOARD_BLE_ENABLED) && BOARD_BLE_ENABLED
|
|
void ble_hid_on_input_notify(bool enabled);
|
|
#endif
|