Keyboard.h: No such file or directory - Arduino pro micro (leonardo)
The Keyboard functions were moved into their own library in Arduino IDE 1.6.6/Arduino AVR Boards 1.6.9. In previous Arduino AVR Boards versions, those functions were part of the core library and there was no Keyboard library or Keyboard.h. Since you're using a very outdated version of the Arduino IDE, you don't have a Keyboard library, thus the error. There are two options to solve this problem:


Remove the line #include &lt;Keyboard.h&gt; from your sketch.
Update to a modern version of the Arduino IDE. Note that when you install the Arduino IDE via sudo apt-get install arduino, you end up with the very outdated IDE version you're using. I recommend always installing the official Arduino IDE downloaded from https://www.arduino.cc/en/Main/Software.




For anyone wanting to write code that's backwards compatible with old IDE versions, you can do this:

#if ARDUINO &gt; 10605
#include &lt;Keyboard.h&gt;
#endif




Reference: https://github.com/arduino/Arduino/pull/3304