Skip to content

Commit

Permalink
fix long press so it actually fires
Browse files Browse the repository at this point in the history
  • Loading branch information
ion098 committed Jun 5, 2024
1 parent 8613f8f commit 7d22c8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gamepad/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void Button::update(const bool is_held) {
if (this->rising_edge) {
this->onPressEvent.fire();
} else if (this->is_pressed && this->time_held >= this->long_press_threshold &&
this->last_long_press_time > pros::millis() - this->time_held) {
this->last_long_press_time <= pros::millis() - this->time_held) {
TODO("change onLongPress handling if onPress is present")
this->onLongPressEvent.fire();
this->last_long_press_time = pros::millis();
Expand Down

0 comments on commit 7d22c8b

Please sign in to comment.