Open
Description
I'm currently working on a project using a Digispark microcontroller (based on the ATTiny85) and the DigiKeyboard library to emulate a USB keyboard. My goal is to send three (piano) keys simultaneously (e.g., 'K', 'X', and 'A'), but I'm facing some difficulties.
#include "DigiKeyboard.h"
void setup() {
DigiKeyboard.delay(5000); // Give time for the system to recognize the device
// Pressing multiple keys
DigiKeyboard.sendKeyPress(KEY_K);
DigiKeyboard.sendKeyPress(KEY_X);
DigiKeyboard.sendKeyPress(KEY_A);
DigiKeyboard.delay(1000); // Hold for a second
// Releasing keys
DigiKeyboard.sendKeyRelease(KEY_K);
DigiKeyboard.sendKeyRelease(KEY_X);
DigiKeyboard.sendKeyRelease(KEY_A);
}
void loop() {
// No continuous actions needed
}
but I see each time I call sendKeyPress() the previous key gets released. Anyway I can keep it pressed?
Metadata
Metadata
Assignees
Labels
No labels