user57908: I'm using a ItsyBitsy 32u4, Adafruit says it can act as a USB HID keyboard. The mc is based on the 32u4 which the Keyboard docs say are supported.
I have a simple sketch that prints "A" every second and should press "A". When I upload the sketch and connect to the serial port I see the print output but I don't get any key presses.
Any ideas? I'm on linux, I suspect that the controller doesn't register as a HID device, maybe I need UDEV rules or drivers?
EDIT: the keyboard works on a different computer.
#include <Keyboard.h>
void setup() {
  Serial.begin(9600);
  Keyboard.begin();
  Serial.println("Start");
}

void loop() {
  Serial.println("a");
  Keyboard.write('a');
  delay(1000);
}


user47961: Keyboard.press() expects a character, but you are passing a character array. Also Keyboard.press() only presses but does not release the key. Keyboard.releaseAll() can be used to release all keys.
I would try:
Keyboard.press('A') ;  //note the ' instead of "
Keyboard.releaseAll();

or preferably:
Keyboard.write('A');   //handles press and release of basic keys


57908: <p>I'm using a <a href="https://www.adafruit.com/product/3677" rel="nofollow noreferrer">ItsyBitsy 32u4</a>, Adafruit says it can act as a USB HID keyboard. The mc is based on the 32u4 which the <a href="https://www.arduino.cc/reference/en/language/functions/usb/keyboard/" rel="nofollow noreferrer">Keyboard</a> docs say are supported.</p>

<p>I have a simple sketch that prints "A" every second and should press "A". When I upload the sketch and connect to the serial port I see the print output but I don't get any key presses.</p>

<p>Any ideas? I'm on linux, I suspect that the controller doesn't register as a HID device, maybe I need UDEV rules or drivers?</p>

<p>EDIT: the keyboard works on a different computer.</p>



<pre class="lang-cpp prettyprint-override"><code>#include &lt;Keyboard.h&gt;
void setup() {
  Serial.begin(9600);
  Keyboard.begin();
  Serial.println("Start");
}

void loop() {
  Serial.println("a");
  Keyboard.write('a');
  delay(1000);
}
</code></pre>
 47961: <p>Keyboard.press() expects a character, but you are passing a character array. Also Keyboard.press() only presses but does not release the key. Keyboard.releaseAll() can be used to release all keys.</p>

<p>I would try:</p>

<pre><code>Keyboard.press('A') ;  //note the ' instead of "
Keyboard.releaseAll();
</code></pre>

<p>or preferably:</p>

<pre><code>Keyboard.write('A');   //handles press and release of basic keys
</code></pre>
