# Ide is not recognizing the keyboard library

**URL:** <https://forum.arduino.cc/t/ide-is-not-recognizing-the-keyboard-library/1456343>\
**Category:** Programming\
**Created:** [August 18, 2026, 10:30pm UTC](https://forum.arduino.cc/t/ide-is-not-recognizing-the-keyboard-library/1456343 "2026-08-18T22:30:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sevenospades7](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sevenospades7/32/1281130_2.png) [@sevenospades7](https://forum.arduino.cc/u/sevenospades7)\
**Post date:** [August 18, 2026, 10:30pm UTC](https://forum.arduino.cc/t/ide-is-not-recognizing-the-keyboard-library/1456343/1 "2026-08-18T22:30:40Z")

</div>

I am trying to make a button box keyboard with an Arduino Nano, but IDE seems to be unable to recognize the commands for the library. It doesn't generate and error for the "#include \<Keyboard.h\>", only for the attempts to use functions from the library. The file location is set correctly in preferences and the library is downloaded, I have tried redownloading it by several methods, nothing has worked. please help.

Error code:

```arduino
F:\4 - Projects\DEWYED\PE Electronics\PE 100 Arduino\PE 110 Sketches\PE 111 Keyboard\sketch_jul10a\sketch_jul10a.ino: In function 'void setup()':
F:\4 - Projects\DEWYED\PE Electronics\PE 100 Arduino\PE 110 Sketches\PE 111 Keyboard\sketch_jul10a\sketch_jul10a.ino:16:1: error: 'Keyboard' was not declared in this scope
 Keyboard.begin();
 ^~
F:\4 - Projects\DEWYED\PE Electronics\PE 100 Arduino\PE 110 Sketches\PE 111 Keyboard\sketch_jul10a\sketch_jul10a.ino: In function 'void loop()':
F:\4 - Projects\DEWYED\PE Electronics\PE 100 Arduino\PE 110 Sketches\PE 111 Keyboard\sketch_jul10a\sketch_jul10a.ino:24:5: error: 'Keyboard' was not declared in this scope
     Keyboard.write('A'); //Sending the "A" character
     ^~
exit status 1

Compilation error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h

```

My code:

```arduino
#include <Keyboard.h>

int pinA = 2; //Declaring variables for the pins
int pinB = 3;
int pinC = 4;
int pinD = 5;
int pinE = 6;

void setup() {

pinMode(pinA, INPUT_PULLUP); //Setting up the internal pull-ups resistors
pinMode(pinB, INPUT_PULLUP); //and also setting the pins to inputs.
pinMode(pinC, INPUT_PULLUP);
pinMode(pinD, INPUT_PULLUP);
pinMode(pinE, INPUT_PULLUP);
Keyboard.begin();

}

void loop() {

  if (digitalRead(pinA) == LOW) //Checking if the first switch has been pressed
  {
    Keyboard.write('A'); //Sending the "A" character
    delay(500);
  }

}

```

If this is in the wrong category let me know.

---

<div class="post-metadata">

**Author:** ![van\_der\_decken](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/van_der_decken/32/1006976_2.png) [@van\_der\_decken](https://forum.arduino.cc/u/van_der_decken)\
**Post date:** [August 18, 2026, 10:36pm UTC](https://forum.arduino.cc/t/ide-is-not-recognizing-the-keyboard-library/1456343/2 "2026-08-18T22:36:33Z")

</div>

> [@sevenospades7](#):
>
> keyboard with an **Arduino Nano**

From the [Keyboard library reference page](https://docs.arduino.cc/language-reference/en/functions/usb/Keyboard/)

> ## Compatible Hardware
> 
> HID is supported on the following boards:
> 
> | **Board** | **Supported Pins** |
> | --- | --- |
> | **[Leonardo](https://docs.arduino.cc/hardware/leonardo)** | All digital & analog pins \> |
> | **[Micro](https://docs.arduino.cc/hardware/micro)** | All digital & analog pins |
> | **[Due](https://docs.arduino.cc/hardware/due)** | All digital & analog pins |
> | **[Zero](https://docs.arduino.cc/hardware/zero)** | All digital & analog pins |
> | **[UNO R4 Minima](https://docs.arduino.cc/hardware/uno-r4-minima)** | All digital & analog pins |
> | **[UNO R4 WiFi](https://docs.arduino.cc/hardware/uno-r4-wifi)** | All digital & analog pins |
> | **[GIGA R1 WiFi](https://docs.arduino.cc/hardware/giga-r1-wifi)** | All digital & analog pins |
> | **[Nano ESP32](https://docs.arduino.cc/hardware/nano-esp32)** | All digital & analog pins |
> | **[MKR Family](https://docs.arduino.cc/#mkr-family)** | All digital & analog pins |

The Nano is not on the list. It will not work with the Keyboard library.

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [August 19, 2026, 4:02am UTC](https://forum.arduino.cc/t/ide-is-not-recognizing-the-keyboard-library/1456343/3 "2026-08-19T04:02:27Z")

</div>

USB OTG Host and device also work on the ESP32-S3

some ESP32-S3 modules have a second USB connector for connecting USB OTG devices, e.g. [ESP32-S3-DevKitC-1 v1.1](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-devkitc-1/user_guide_v1.1.html)
