Skip to content

Commit

Permalink
Fix bug with fast repeated keypresses
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnu-Bricoleur committed Jun 28, 2024
1 parent 456ce03 commit 952c5bb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/input/SerialKeyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,15 @@ int32_t SerialKeyboard::runOnce()
if (keyPressed < 11){
if (keyPressed == lastKeyPressed && millis()-lastPressTime < 500){
quickPress += 1;
if (quickPress > 4){
if (quickPress > 3){
quickPress = 0;
}
}
if (keyPressed != lastKeyPressed){
quickPress = 0;
}
if (keyPressed < 10){ // if it's a letter
if (quickPress > 0){
if (keyPressed == lastKeyPressed && millis()-lastPressTime < 500){
erase();
}
e.inputEvent = ANYKEY;
Expand Down

0 comments on commit 952c5bb

Please sign in to comment.