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:
Earle F. Philhower, III
2023-03-15 19:10:31 -07:00
committed by GitHub
parent 3dbe5cf930
commit 1dfd9ebac7
9 changed files with 39 additions and 5 deletions
+10
View File
@@ -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;