File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -206,6 +206,8 @@ namespace klib::usb::device {
206206 key_media_eject = 0xb8 ,
207207 };
208208
209+ static_assert (sizeof (consumer_key_t ) == sizeof (uint16_t ), " invalid consumer keys size" );
210+
209211 protected:
210212 /* *
211213 * @brief Enum with the string descriptor indexes
@@ -272,7 +274,8 @@ namespace klib::usb::device {
272274 .bNumConfigurations = 0x1
273275 };
274276
275- // report descriptor for the hid keyboard
277+ // report descriptor for the hid keyboard. We need 2 report ids
278+ // so windows recognizes both the keyboard and consumer control
276279 const __attribute__ ((aligned(4 ))) static inline uint8_t report_desc[] = {
277280 // Keyboard report (Report ID 1)
278281 0x05 , 0x01 , // Usage Page (Generic Desktop)
@@ -397,6 +400,7 @@ namespace klib::usb::device {
397400 // fixed report id for the consumer control
398401 const report_id id = report_id::consumer;
399402
403+ // key data
400404 consumer_key_t key;
401405 };
402406
You can’t perform that action at this time.
0 commit comments