Skip to content

Commit 638be04

Browse files
authored
fix: USB HID Keyboard raw report
1 parent 1788867 commit 638be04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: libraries/USB/src/USBHIDKeyboard.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ size_t USBHIDKeyboard::pressRaw(uint8_t k)
222222
uint8_t i;
223223
if (k >= 0xE0 && k < 0xE8) {
224224
// it's a modifier key
225-
_keyReport.modifiers |= (1<<(k-0x80));
225+
_keyReport.modifiers |= (1<<(k-0xE0));
226226
} else if (k && k < 0xA5) {
227227
// Add k to the key report only if it's not already present
228228
// and if there is an empty slot.
@@ -253,7 +253,7 @@ size_t USBHIDKeyboard::releaseRaw(uint8_t k)
253253
uint8_t i;
254254
if (k >= 0xE0 && k < 0xE8) {
255255
// it's a modifier key
256-
_keyReport.modifiers &= ~(1<<(k-0x80));
256+
_keyReport.modifiers &= ~(1<<(k-0xE0));
257257
} else if (k && k < 0xA5) {
258258
// Test the key report to see if k is present. Clear it if it exists.
259259
// Check all positions in case the key is present more than once (which it shouldn't be)

0 commit comments

Comments
 (0)