Skip to content

Commit

Permalink
fix: USB HID Keyboard raw report (#9473)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuGlider authored and me-no-dev committed Apr 10, 2024
1 parent 4465cac commit 83372a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/USB/src/USBHIDKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,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 @@ -250,7 +250,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

0 comments on commit 83372a3

Please sign in to comment.