Skip to content

Commit

Permalink
Fix race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Oct 29, 2024
1 parent 18e2654 commit 9e67567
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions application/components/KeypadButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ Item {

function setPressed() {
button.down = true;
onButtonPressed();
control.triggeredByKeyboard = true;
onButtonPressed(true);
}

function setReleased() {
button.down = false;
onButtonReleased();
}

function onButtonPressed() {
control.triggeredByKeyboard = false;
function onButtonPressed(triggeredByKeyboard) {
control.triggeredByKeyboard = triggeredByKeyboard;

if(!longTimer.running) {
longTimer.start();
Expand Down Expand Up @@ -73,7 +72,7 @@ Item {
id: button
anchors.centerIn: parent

onPressed: onButtonPressed()
onPressed: onButtonPressed(false)
onReleased: onButtonReleased()
}

Expand Down

0 comments on commit 9e67567

Please sign in to comment.