Add touch reader controls for page navigation
Implements tap zones on touch devices for page back/forward navigation and press-and-hold actions, mirroring physical button behavior. Adds isXteinkDevice() helper to distinguish Xteink X3/X4 boards from touch devices. The sunlight fading fix setting is now exclusive to Xteink devices, while touch devices get the new touch reader controls toggle instead.
This commit is contained in:
@@ -251,6 +251,11 @@ unsigned long HalGPIO::lastTouchHeldMs() const { return inputMgr.lastTouchHeldMs
|
||||
|
||||
bool HalGPIO::hasTouch() const { return inputMgr.hasTouch(); }
|
||||
|
||||
bool HalGPIO::isXteinkDevice() const {
|
||||
const auto board = BoardConfig::ACTIVE.board;
|
||||
return board == BoardConfig::Board::XteinkX3 || board == BoardConfig::Board::XteinkX4;
|
||||
}
|
||||
|
||||
void HalGPIO::startDeepSleep() {
|
||||
// Ensure that the power button has been released to avoid immediately turning back on if you're holding it
|
||||
while (inputMgr.isPressed(BTN_POWER)) {
|
||||
|
||||
@@ -59,6 +59,13 @@ class HalGPIO {
|
||||
inline bool deviceIsX3() const { return _deviceType == DeviceType::X3; }
|
||||
inline bool deviceIsX4() const { return _deviceType == DeviceType::X4; }
|
||||
|
||||
// True on the Xteink X3/X4 transflective C3 boards. Distinct from
|
||||
// deviceIsX3/X4 (which only tell the two C3 variants apart and both stay
|
||||
// "X4" on non-C3 boards): this keys off BoardConfig::ACTIVE.board, so it is
|
||||
// the reliable "is this an Xteink device" check used to gate features that
|
||||
// are Xteink-only (sunlight fading fix) or non-Xteink-only (touch controls).
|
||||
bool isXteinkDevice() const;
|
||||
|
||||
// Start button GPIO and setup SPI for screen and SD card
|
||||
void begin();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user