I have an Arduino Uno and I am trying to send keyboard commands to the computer after a pushbutton is activated. Every time I try to use:
char DispatchKey = KEY_ENTER;
along with...
Keyboard.press(DispatchKey);
later on the code I get a couple of error messages when I try to verify it such as: "'KEY_ENTER' was not declared in this scope."
I'm not really sure what I am doing wrong. I'm pretty much following this example: Keyboard.press() - Arduino Reference just using the enter key instead of the left control key.
USB connectivity is handled by the ATmega8u2 or ATmega16u2 (depending on which version) on the Uno. You can reprogram this chip to act as a HID Device (USB term for Keyboard or Mouse). However, you lose the USB-to-serial functionality when you do that.
There are some projects which attempt to make a HID device with the ATmega328, but they generally do not work very well since they are not true differential signaling.
Gobetwino, if you are on Windows, may be the most straightforward method.