diff --git a/software/o_c_REV/OC_ui.cpp b/software/o_c_REV/OC_ui.cpp index 67e19dd6..8b64405f 100644 --- a/software/o_c_REV/OC_ui.cpp +++ b/software/o_c_REV/OC_ui.cpp @@ -79,11 +79,15 @@ void FASTRUN Ui::Poll() { auto &button = buttons_[i]; if (button.just_pressed()) { button_press_time_[i] = now; + } else if (button.pressed()) { + if (now - button_press_time_[i] == kLongPressTicks) + { + button_state &= ~control_mask(i); + PushEvent(UI::EVENT_BUTTON_LONG_PRESS, control_mask(i), 0, button_state); + } } else if (button.released()) { - if (now - button_press_time_[i] < kLongPressTicks) + if (now - button_press_time_[i] < kLongPressTicks + 7) PushEvent(UI::EVENT_BUTTON_PRESS, control_mask(i), 0, button_state); - else - PushEvent(UI::EVENT_BUTTON_LONG_PRESS, control_mask(i), 0, button_state); } }