Skip to content

Commit 83372a3

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/USB/src/USBHIDKeyboard.cpp

Lines changed: 2 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy