Update logic to avoid collision
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user