mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-23 01:18:12 -07:00
BadUSB: BLE, media keys, Fn/Globe key commands (#3403)
* BadUSB: media keys, GLOBE command * f18 api table fix * BadUSB over BLE * Made PVS happy Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
entry,status,name,type,params
|
||||
Version,+,60.1,,
|
||||
Version,+,60.2,,
|
||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||
Header,+,applications/services/cli/cli.h,,
|
||||
Header,+,applications/services/cli/cli_vcp.h,,
|
||||
@@ -1205,6 +1205,7 @@ Function,+,furi_hal_gpio_init_simple,void,"const GpioPin*, const GpioMode"
|
||||
Function,+,furi_hal_gpio_remove_int_callback,void,const GpioPin*
|
||||
Function,+,furi_hal_hid_consumer_key_press,_Bool,uint16_t
|
||||
Function,+,furi_hal_hid_consumer_key_release,_Bool,uint16_t
|
||||
Function,+,furi_hal_hid_consumer_key_release_all,_Bool,
|
||||
Function,+,furi_hal_hid_get_led_state,uint8_t,
|
||||
Function,+,furi_hal_hid_is_connected,_Bool,
|
||||
Function,+,furi_hal_hid_kb_press,_Bool,uint16_t
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
entry,status,name,type,params
|
||||
Version,+,60.1,,
|
||||
Version,+,60.2,,
|
||||
Header,+,applications/drivers/subghz/cc1101_ext/cc1101_ext_interconnect.h,,
|
||||
Header,+,applications/services/bt/bt_service/bt.h,,
|
||||
Header,+,applications/services/cli/cli.h,,
|
||||
@@ -1273,6 +1273,7 @@ Function,+,furi_hal_gpio_init_simple,void,"const GpioPin*, const GpioMode"
|
||||
Function,+,furi_hal_gpio_remove_int_callback,void,const GpioPin*
|
||||
Function,+,furi_hal_hid_consumer_key_press,_Bool,uint16_t
|
||||
Function,+,furi_hal_hid_consumer_key_release,_Bool,uint16_t
|
||||
Function,+,furi_hal_hid_consumer_key_release_all,_Bool,
|
||||
Function,+,furi_hal_hid_get_led_state,uint8_t,
|
||||
Function,+,furi_hal_hid_is_connected,_Bool,
|
||||
Function,+,furi_hal_hid_kb_press,_Bool,uint16_t
|
||||
|
||||
|
@@ -354,6 +354,13 @@ bool furi_hal_hid_consumer_key_release(uint16_t button) {
|
||||
return hid_send_report(ReportIdConsumer);
|
||||
}
|
||||
|
||||
bool furi_hal_hid_consumer_key_release_all(void) {
|
||||
for(uint8_t key_nb = 0; key_nb < HID_CONSUMER_MAX_KEYS; key_nb++) {
|
||||
hid_report.consumer.btn[key_nb] = 0;
|
||||
}
|
||||
return hid_send_report(ReportIdConsumer);
|
||||
}
|
||||
|
||||
static void* hid_set_string_descr(char* str) {
|
||||
furi_assert(str);
|
||||
|
||||
|
||||
@@ -14,6 +14,11 @@ extern "C" {
|
||||
/** Max number of simultaneously pressed keys (consumer control) */
|
||||
#define HID_CONSUMER_MAX_KEYS 2
|
||||
|
||||
/** OS-specific consumer keys, defined as "Reserved" in HID Usage Tables document */
|
||||
#define HID_CONSUMER_BRIGHTNESS_INCREMENT 0x006F
|
||||
#define HID_CONSUMER_BRIGHTNESS_DECREMENT 0x0070
|
||||
#define HID_CONSUMER_FN_GLOBE 0x029D
|
||||
|
||||
#define HID_KEYBOARD_NONE 0x00
|
||||
|
||||
/** HID keyboard modifier keys */
|
||||
@@ -259,6 +264,11 @@ bool furi_hal_hid_consumer_key_press(uint16_t button);
|
||||
*/
|
||||
bool furi_hal_hid_consumer_key_release(uint16_t button);
|
||||
|
||||
/** Clear all pressed consumer keys and send HID report
|
||||
*
|
||||
*/
|
||||
bool furi_hal_hid_consumer_key_release_all(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user