crosspoint-reader/src/MappedInputManager.h
cottongin 3853bfe113
Some checks are pending
CI / build (push) Waiting to run
feat: widen battery icons and add charging indicator
- Increase battery width to 1.5x original (small: 15→23px, large: 20→30px)
- Add lightning bolt overlay when USB/charging detected
- Bolt traced from SVG, centered in fill area regardless of charge level
- Add isUsbConnected() to MappedInputManager for charging detection
- Update layout spacing constants for wider battery
2026-02-03 20:11:28 -05:00

32 lines
800 B
C++

#pragma once
#include <HalGPIO.h>
class MappedInputManager {
public:
enum class Button { Back, Confirm, Left, Right, Up, Down, Power, PageBack, PageForward };
struct Labels {
const char* btn1;
const char* btn2;
const char* btn3;
const char* btn4;
};
explicit MappedInputManager(HalGPIO& gpio) : gpio(gpio) {}
bool wasPressed(Button button) const;
bool wasReleased(Button button) const;
bool isPressed(Button button) const;
bool wasAnyPressed() const;
bool wasAnyReleased() const;
unsigned long getHeldTime() const;
bool isUsbConnected() const;
Labels mapLabels(const char* back, const char* confirm, const char* previous, const char* next) const;
private:
HalGPIO& gpio;
bool mapButton(Button button, bool (HalGPIO::*fn)(uint8_t) const) const;
};