Skip to content

USB USBHIDKeyboard::pressRaw() modifier key not working  #9377

Closed
@EmileSpecialProducts

Description

@EmileSpecialProducts

Board

ESP32-S3

Device Description

ESP32-S3

Hardware Configuration

USB connection on ESP32-S3

Version

latest master (checkout manually)

IDE Name

PlatformIO / not relavant

Operating System

Win

Flash frequency

80Mhz

PSRAM enabled

no

Upload speed

USB

Description

The modifiers are not working for the USBHIDKeyboard::pressRaw(uint8_t k)/ USBHIDKeyboard::releaseRaw(uint8_t k)
The modifiers are between 0xe0 and 0xe8 this will represent the Bit in the _keyReport.modifiers.
Then you will need to subtract 0xe0 and not 0x80

Original code:

    if (k >= 0xE0 && k < 0xE8) {
        // it's a modifier key
        _keyReport.modifiers |= (1<<(k-0x80));

Needs to be

    if (k >= 0xE0 && k < 0xE8) {
        // it's a modifier key
        _keyReport.modifiers |= (1<<(k-0xE0));

Sketch

not provided.

Debug Message

There is not debug information

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions