Page 1 of 1

How to turn on or off the LEDs of an USB keyboard?

Posted: Thu Jul 25, 2024 11:43 pm
by sraposo
I am developing an ESP32S3-based device that has to be able to host a standard USB keyboard

The "usb_host_lib" example (https://github.com/espressif/esp-idf/tr ... t_lib/main) works properly to deliver user's keystrokes to the hid host , but does not show how to command CAPS LOCK, NUM LOCK and SCROLL LOCK LEDs of the keyboard.

I have been trying to find how to effectively do it without causing keyboard to disconnect. Function hid_class_request_set_report, depending on the place where it is called, makes the target LED to light, but soon keyboard is disconnected and LED turns off.

Has anyone solved this yet? Any clue?