Am I correct in reading that the Due can act as a keyboard to a PC so that I can send keyboard key commands to my windows 7 app to 'press a button' via a short cut key?
Here is my sketch. It compiles successfully and the serial window is displaying 'Loop' every 5 secs so it is running, but the win7 app doesn't respond to my Due sending the F6 key stroke to it.
Maybe I'm forgetting to do something?
Thanks for any help...
#include <Keyboard.h>
void setup() {
Serial.begin(9600);
Serial.println("Setup");
}
void loop() {
Serial.println("Loop");
Keyboard.press(KEY_F6);
delay(200);
Keyboard.releaseAll();
delay(3000);
}
I forgot to add the statement Keyboard.begin() so I added it but it didn't seem to make a difference.
#include <Keyboard.h>
void setup() {
Serial.begin(9600);
Serial.println("Setup");
Keyboard.begin();
}
void loop() {
Serial.println("Loop");
Keyboard.press(KEY_F6);
delay(200);
Keyboard.releaseAll();
delay(3000);
}
oqibidipo:
Hmm... Works for me™.
Checklist:
- Are you using the native USB port?
No, I'm using the programming port...is that the right one? At first I did use the native port but when it didn't work, I switched over to the other one.
Keyboard and Mouse work only through the native port.
oqibidipo:
Keyboard and Mouse work only through the native port.
Thanks, I went back to the Native port and its working now.
Thank you very much for the help.