fix: USB HID Keyboard raw report (#9473)
This commit is contained in:
parent
858b107bdf
commit
8ceb4bacb2
1 changed files with 2 additions and 2 deletions
|
|
@ -222,7 +222,7 @@ size_t USBHIDKeyboard::pressRaw(uint8_t k)
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
if (k >= 0xE0 && k < 0xE8) {
|
if (k >= 0xE0 && k < 0xE8) {
|
||||||
// it's a modifier key
|
// it's a modifier key
|
||||||
_keyReport.modifiers |= (1<<(k-0x80));
|
_keyReport.modifiers |= (1<<(k-0xE0));
|
||||||
} else if (k && k < 0xA5) {
|
} else if (k && k < 0xA5) {
|
||||||
// Add k to the key report only if it's not already present
|
// Add k to the key report only if it's not already present
|
||||||
// and if there is an empty slot.
|
// and if there is an empty slot.
|
||||||
|
|
@ -253,7 +253,7 @@ size_t USBHIDKeyboard::releaseRaw(uint8_t k)
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
if (k >= 0xE0 && k < 0xE8) {
|
if (k >= 0xE0 && k < 0xE8) {
|
||||||
// it's a modifier key
|
// it's a modifier key
|
||||||
_keyReport.modifiers &= ~(1<<(k-0x80));
|
_keyReport.modifiers &= ~(1<<(k-0xE0));
|
||||||
} else if (k && k < 0xA5) {
|
} else if (k && k < 0xA5) {
|
||||||
// Test the key report to see if k is present. Clear it if it exists.
|
// 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)
|
// Check all positions in case the key is present more than once (which it shouldn't be)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue