Skip to content

Commit

Permalink
Add twist to commands (#727)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoSloppy authored Jan 29, 2025
1 parent 8df27bc commit 2376b4d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions props/saber_BC_buttons.h
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,24 @@ struct BCVolumeMode : public SPEC::SteppedMode {
SPEC::SteppedMode::exit();
}

bool Parse(const char *cmd, const char* arg) override {
if (PropBase::Parse(cmd, arg)) return true;

if (!strcmp(cmd, "twist")) {
Event(BUTTON_NONE, EVENT_TWIST);
return true;
}
if (!strcmp(cmd, "left")) {
Event(BUTTON_NONE, EVENT_TWIST_LEFT);
return true;
}
if (!strcmp(cmd, "right")) {
Event(BUTTON_NONE, EVENT_TWIST_RIGHT);
return true;
}
return false;
}

bool mode_Event2(enum BUTTON button, EVENT event, uint32_t modifiers) override {
switch (EVENTID(button, event, 0)) {
// Custom button controls for BCVolumeMode
Expand Down

0 comments on commit 2376b4d

Please sign in to comment.