Skip to content

Commit

Permalink
Bugfix - don't set sticky shift if a matrix pad was pressed (Synthstr…
Browse files Browse the repository at this point in the history
…omAudible#2095)

* don't set sticky shift if a matrix pad was pressed

* relocate comment for clarity
  • Loading branch information
m-m-adams committed Jun 5, 2024
1 parent 0e096f8 commit 9ecc6bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/deluge/deluge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,13 @@ bool readButtonsAndPads() {
ActionResult result;
if (Pad::isPad(util::to_underlying(value))) {
auto p = Pad(util::to_underlying(value));
result = matrixDriver.padAction(p.x, p.y, thisPadPressIsOn);
/* while this function takes an int32_t for velocity, 255 indicates to the downstream audition pad
* function that it should use the default velocity for the instrument
*/
result = matrixDriver.padAction(p.x, p.y, thisPadPressIsOn);
if (thisPadPressIsOn) {
Buttons::ignoreCurrentShiftForSticky();
}
}
else {
auto b = deluge::hid::Button(value);
Expand Down
3 changes: 3 additions & 0 deletions src/deluge/hid/buttons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,7 @@ void noPressesHappening(bool inCardRoutine) {
}
}
}
void ignoreCurrentShiftForSticky() {
considerShiftReleaseForSticky = false;
}
} // namespace Buttons
2 changes: 1 addition & 1 deletion src/deluge/hid/buttons.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ActionResult buttonAction(deluge::hid::Button b, bool on, bool inCardRoutine);
bool isButtonPressed(deluge::hid::Button b);
bool isShiftButtonPressed();
void noPressesHappening(bool inCardRoutine);

void ignoreCurrentShiftForSticky();
/**
* Notify the button management code that the shift button should no longer be considered sticky. We need an explicit
* notification so we can clear the buttons.cpp:shiftIsHeld to avoid shift getting permanantly stuck.
Expand Down

0 comments on commit 9ecc6bf

Please sign in to comment.