Hi. I tried to make 2-key keyboard with my digispark, but I can't simultaneously push the twice button.
I tried to use the buffers but I didn't know how to do it.
Because the sendKeyboard() holds the button continuously pressed at the delay(), it uses sendKeyPress() to hold the button pressed.
However, I would like to find a way to keep the two buttons at the same time, because I only know how to release the buttons. This is a translation using a translator.

#include <Digikeyboard.h>
typedef struct {
byte Pin;
byte Key;
boolean Press;
} BUTTON;
void ButtonRead(BUTTON* Btn){
int State = digitalRead(Btn->Pin);
if(State==HIGH&&State!=Btn->Press){
Btn->Press = State;
DigiKeyboard.sendKeyPress(0);
}
else if(State==LOW&&State!=Btn->Press){
Btn->Press = State;
DigiKeyboard.sendKeyPress(Btn->Key);
}
}
BUTTON Btn1 = {2,KEY_Z,false};
BUTTON Btn2 = {0,KEY_X,false};
void setup() {
pinMode(0,INPUT_PULLUP);
pinMode(2,INPUT_PULLUP);
DigiKeyboard.sendKeyStroke(0);
}
void loop() {
ButtonRead(&Btn1);
ButtonRead(&Btn2);
DigiKeyboard.delay(10);
}