#include <Keyboard.h>
const int buttonPin = 2;
bool wasPressed = false;
void setup() {
pinMode(buttonPin, INPUT_PULLUP);
Keyboard.begin();
}
void loop() {
bool isPressed = digitalRead(buttonPin) == LOW;
if (isPressed && !wasPressed) {
Keyboard.press('f');
delay(100);
Keyboard.release('f');
}
wasPressed = isPressed;
}