Skip to content

fix: USB HID Keyboard raw report #9473

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

Merged
merged 1 commit into from
Apr 10, 2024
Merged
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
fix: USB HID Keyboard raw report
  • Loading branch information
SuGlider authored Apr 9, 2024
commit 638be04296a56c2ea5b7c171ecd547a848adb3cc
4 changes: 2 additions & 2 deletions libraries/USB/src/USBHIDKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ size_t USBHIDKeyboard::pressRaw(uint8_t k)
uint8_t i;
if (k >= 0xE0 && k < 0xE8) {
// it's a modifier key
_keyReport.modifiers |= (1<<(k-0x80));
_keyReport.modifiers |= (1<<(k-0xE0));
} else if (k && k < 0xA5) {
// Add k to the key report only if it's not already present
// and if there is an empty slot.
Expand Down Expand Up @@ -253,7 +253,7 @@ size_t USBHIDKeyboard::releaseRaw(uint8_t k)
uint8_t i;
if (k >= 0xE0 && k < 0xE8) {
// it's a modifier key
_keyReport.modifiers &= ~(1<<(k-0x80));
_keyReport.modifiers &= ~(1<<(k-0xE0));
} else if (k && k < 0xA5) {
// Test the key report to see if k is present. Clear it if it exists.
// Check all positions in case the key is present more than once (which it shouldn't be)
Expand Down