Update logic to avoid collision

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
jpirnay
2026-04-26 16:46:22 +02:00
co-authored by Copilot
parent a1d0ddec49
commit f0fe02d77a
34 changed files with 233 additions and 294 deletions
+6 -4
View File
@@ -26,8 +26,6 @@ class ButtonEventManager {
public:
using Button = MappedInputManager::Button;
static constexpr int NUM_BUTTONS = 9; // matches MappedInputManager::Button count
enum class PressType { Short, Double, Long };
struct ButtonEvent {
@@ -56,9 +54,13 @@ class ButtonEventManager {
static bool hasDoubleAction(Button button);
private:
// Up and Down alias the same physical GPIO pins as PageBack/PageForward (via sideButtonLayout).
// Running separate FSMs for both would double-fire on every side button press.
// Up/Down are therefore excluded here; their configurable actions are resolved in main.cpp
// by treating a PageBack/PageForward event as the canonical side-button event.
static constexpr int NUM_BUTTONS = 7;
static constexpr Button ALL_BUTTONS[NUM_BUTTONS] = {
Button::Back, Button::Confirm, Button::Left, Button::Right, Button::Up,
Button::Down, Button::PageBack, Button::PageForward, Button::Power,
Button::Back, Button::Confirm, Button::Left, Button::Right, Button::PageBack, Button::PageForward, Button::Power,
};
enum class State { Idle, Pressed, ReleasedOnce, DoublePressed };