Im doing a program that will press CTRL+F7.
Im using a Teensy 3.1 to emulate that key combo.
I cant get the press to work.
I only get CTRL then F7 not CTRL+F7. So CTRL is not pressed.
Im been looking at ww.pjrc.com at there example and seems like im doing it right.
#include <usb_keyboard.h>
const int led = LED_BUILTIN;
void setup() {
}
void loop() {
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led, LOW);
delay(100);
// press and hold CTRL
Keyboard.set_modifier(MODIFIERKEY_CTRL);
Keyboard.send_now();
// press DELETE, while CLTR and ALT still held
Keyboard.set_key1(KEY_F7);
Keyboard.send_now();
// release all the keys at the same instant
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.send_now();
delay(2000);
}
sorry, about the comment. It from the original example code.
i have tried
// press and hold CTRL
Keyboard.set_modifier(MODIFIERKEY_CTRL);
Keyboard.set_key1(KEY_F7);
Keyboard.send_now();
// release all the keys at the same instant
Keyboard.set_modifier(0);
Keyboard.set_key1(0);
Keyboard.send_now();