Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8ceb4ba

Browse filesBrowse files
authored
fix: USB HID Keyboard raw report (espressif#9473)
1 parent 858b107 commit 8ceb4ba
Copy full SHA for 8ceb4ba

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

‎libraries/USB/src/USBHIDKeyboard.cpp

Copy file name to clipboardExpand all lines: libraries/USB/src/USBHIDKeyboard.cpp
+2-2Lines changed: 2 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.