I've been searching on the forum for Keyboard.press problems and have a question about which style I should be using for a Teensy 3.6.
This style:
or this style:
I have a windows app running and my small test sketch doesn't seem to be sending the F1 key press to that app. In the windows app, I should see a button being pressed down when the F1 key press is sent. I can manually press F1 on my keyboard and see the button depress, but when I run the sketch, the button depress does not happen in the app.
Thank you.
This style:
Code:
Keyboard.begin();
Keyboard.press(KEY_F1);
delay(250);
Keyboard.releaseAll();
or this style:
Code:
Keyboard.set_key1(KEY_F1);
Keyboard.send_now();
delay(250);
Keyboard.set_key1(0);
Keyboard.send_now();
I have a windows app running and my small test sketch doesn't seem to be sending the F1 key press to that app. In the windows app, I should see a button being pressed down when the F1 key press is sent. I can manually press F1 on my keyboard and see the button depress, but when I run the sketch, the button depress does not happen in the app.
Thank you.
Code:
#include <Keyboard.h>
void setup()
{
Keyboard.begin();
Keyboard.press(KEY_F1);
delay(250);
Keyboard.releaseAll();
}
void loop()
{
}