Add opds image download

This commit is contained in:
jpirnay
2026-05-10 20:47:35 +02:00
parent c4b94737fd
commit 80eb889256
8 changed files with 100 additions and 28 deletions
+16 -3
View File
@@ -49,6 +49,16 @@ class ButtonEventManager {
// Reset all per-button FSMs. Call on activity transitions to prevent bleed-through.
void drain();
// Temporarily force double-click detection for a button (adds latency to Short press).
// Call this in the Activity's transition setup or loop.
void forceDoubleAction(Button button, bool enable = true) {
if (enable) {
forcedDoubleMask |= (1 << static_cast<int>(button));
} else {
forcedDoubleMask &= ~(1 << static_cast<int>(button));
}
}
// Preserve a default event for activity processing after main loop dispatch.
// This is used when the configured action is BTN_DEFAULT.
void pushEventFront(Button button, PressType type);
@@ -59,14 +69,17 @@ class ButtonEventManager {
// Returns true if a double-click action is configured for this button.
// ButtonEventManager queries CrossPointSettings internally.
static bool hasDoubleAction(Button button);
bool hasDoubleAction(Button button) const;
private:
static constexpr int NUM_BUTTONS = 7;
static constexpr int NUM_BUTTONS = 9;
static constexpr Button ALL_BUTTONS[NUM_BUTTONS] = {
Button::Back, Button::Confirm, Button::Left, Button::Right, Button::PageBack, Button::PageForward, Button::Power,
Button::Back, Button::Confirm, Button::Left, Button::Right, Button::Up,
Button::Down, Button::PageBack, Button::PageForward, Button::Power,
};
uint32_t forcedDoubleMask = 0;
enum class State { Idle, Pressed, ReleasedOnce, DoublePressed };
struct PerButton {