Skip to content

Commit

Permalink
fix: USB HID Keyboard raw report (espressif#9473)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuGlider authored and P-R-O-C-H-Y committed Apr 16, 2024
1 parent c15053f commit 53f902f
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 @@ -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

0 comments on commit 53f902f

Please sign in to comment.