Skip to content

Commit 83372a3

Browse files
SuGliderme-no-dev
authored andcommitted
fix: USB HID Keyboard raw report (#9473)
1 parent 4465cac commit 83372a3

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
@@ -219,7 +219,7 @@ size_t USBHIDKeyboard::pressRaw(uint8_t k)
219219
uint8_t i;
220220
if (k >= 0xE0 && k < 0xE8) {
221221
// it's a modifier key
222-
_keyReport.modifiers |= (1<<(k-0x80));
222+
_keyReport.modifiers |= (1<<(k-0xE0));
223223
} else if (k && k < 0xA5) {
224224
// Add k to the key report only if it's not already present
225225
// and if there is an empty slot.
@@ -250,7 +250,7 @@ size_t USBHIDKeyboard::releaseRaw(uint8_t k)
250250
uint8_t i;
251251
if (k >= 0xE0 && k < 0xE8) {
252252
// it's a modifier key
253-
_keyReport.modifiers &= ~(1<<(k-0x80));
253+
_keyReport.modifiers &= ~(1<<(k-0xE0));
254254
} else if (k && k < 0xA5) {
255255
// Test the key report to see if k is present. Clear it if it exists.
256256
// Check all positions in case the key is present more than once (which it shouldn't be)

0 commit comments

Comments
 (0)