Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DOUBLE_REPORT to fix RDP modifier key reliability #19449

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions quantum/action_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,21 @@ void send_keyboard_report(void) {
keyboard_report->mods |= weak_override_mods;
#endif

#ifdef PROTOCOL_VUSB
host_keyboard_send(keyboard_report);
#else
static report_keyboard_t last_report;

#ifndef PROTOCOL_VUSB
/* Only send the report if there are changes to propagate to the host. */
if (memcmp(keyboard_report, &last_report, sizeof(report_keyboard_t)) != 0) {
if (memcmp(&last_report, keyboard_report, sizeof(report_keyboard_t)) != 0)
#endif
{
memcpy(&last_report, keyboard_report, sizeof(report_keyboard_t));
host_keyboard_send(keyboard_report);
}

#ifdef DOUBLE_REPORT
memcpy(keyboard_report, &last_report, sizeof(report_keyboard_t)); // host_keyboard_send() sometimes modifies keyboard_report to handle protocol details, so restore the original from last_report
host_keyboard_send(keyboard_report);
#endif
}
}

/** \brief Get mods
Expand Down