Nano ESP32 not working with Keyboard library

Hello,

I have a Nano ESP32 and im trying to compile some code that is using the lib Keyboard and i get the :
fatal error: HID.h: No such file or directory
#include "HID.h"
^~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1

When i look if the library is supporting the board , it was on the list:

The code that i try to run is from this link:

I try to run the same code on leonardo board and is compiling.

Im doing something wrong ?

Thank you in advances for the responses.

Welcome to the forum

Have you read the documentation for the Keyboard library ?

This part is particularly relevant

The keyboard functions enable 32u4 or SAMD micro based boards to send keystrokes to an attached computer through their micro’s native USB port.

The Nano ESP32 does not have a compatible processor as is evident from its name

1 Like

Hi @cuassar. There is equivalent functionality to the "Keyboard" library for the Nano ESP32. You can learn how to use it by studying the examples that are listed under the File > Examples > USB > Keyboard menu in Arduino IDE.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.