Add HID consumer (aka media) keys for USB, BT (#1309)
Allow sending thigns like KEY_MUTE or KEY_SCAN_NEXT from the USB and Bluetooth Classic keyboard libraries. BLE requires some add'l magic, not yet discovered. Pull in latest upstream Keyboard library changes
This commit was merged in pull request #1309.
This commit is contained in:
@@ -46,6 +46,16 @@ void Keyboard_::sendReport(KeyReport* keys) {
|
||||
tud_task();
|
||||
}
|
||||
|
||||
void Keyboard_::sendConsumerReport(uint16_t key) {
|
||||
CoreMutex m(&__usb_mutex);
|
||||
tud_task();
|
||||
if (tud_hid_ready()) {
|
||||
tud_hid_report(__USBGetKeyboardReportID() + 1, &key, sizeof(key));
|
||||
}
|
||||
tud_task();
|
||||
}
|
||||
|
||||
|
||||
extern "C" void tud_hid_set_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize) {
|
||||
(void) report_id;
|
||||
(void) instance;
|
||||
|
||||
Reference in New Issue
Block a user