@@ -541,6 +541,26 @@ uint16_t kb_mouse_handle_get_report(uint8_t report_id, uint8_t* buffer, uint16_t
541541 return 0 ;
542542}
543543
544+ bool kb_mouse_should_cause_wakeup (uint8_t report_id, const uint8_t * buffer, uint16_t len) {
545+ if ((report_id == REPORT_ID_KEYBOARD ) || (report_id == REPORT_ID_CONSUMER )) {
546+ for (uint16_t i = 0 ; i < len; i++) {
547+ if (buffer[i] != 0 ) {
548+ return true ;
549+ }
550+ }
551+ return false ;
552+ }
553+
554+ if (report_id == REPORT_ID_MOUSE ) {
555+ if ((len > 0 ) && (buffer[0 ] != 0 )) {
556+ return true ;
557+ }
558+ return false ;
559+ }
560+
561+ return false ;
562+ }
563+
544564static const uint8_t horipad_neutral[] = { 0x00 , 0x00 , 0x0F , 0x80 , 0x80 , 0x80 , 0x80 , 0x00 };
545565
546566void horipad_clear_report (uint8_t * report, uint8_t report_id, uint16_t len) {
@@ -618,6 +638,7 @@ const our_descriptor_def_t our_descriptors[] = {
618638 .handle_get_report = kb_mouse_handle_get_report,
619639 .handle_set_report = kb_mouse_handle_set_report,
620640 .set_report_synchronous = kb_mouse_set_report_synchronous,
641+ .should_cause_wakeup = kb_mouse_should_cause_wakeup,
621642 },
622643 {
623644 .idx = 1 ,
@@ -627,6 +648,7 @@ const our_descriptor_def_t our_descriptors[] = {
627648 .handle_get_report = kb_mouse_handle_get_report,
628649 .handle_set_report = kb_mouse_handle_set_report,
629650 .set_report_synchronous = kb_mouse_set_report_synchronous,
651+ .should_cause_wakeup = kb_mouse_should_cause_wakeup,
630652 },
631653 {
632654 .idx = 2 ,
0 commit comments