Add touch gesture to open reader menu
Implements a press-and-hold gesture in the center touch zone (400ms threshold) that opens the reader menu, mirroring the Confirm button behavior. The center third of the screen is now reserved for this menu gesture, while left and right thirds continue to handle page turns. Applied to both EPUB and XTC readers.
This commit is contained in:
@@ -53,8 +53,14 @@ void XtcReaderActivity::onExit() {
|
||||
}
|
||||
|
||||
void XtcReaderActivity::loop() {
|
||||
// Enter chapter selection activity
|
||||
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
|
||||
// Touch reader controls mirror the side page buttons (left third = back, right
|
||||
// third = forward, press-and-hold = chapter skip) and the Confirm button
|
||||
// (center press-and-hold = chapter selection). No-op on Xteink / when the
|
||||
// setting is off.
|
||||
const auto touch = ReaderUtils::detectTouchPageTurn(renderer);
|
||||
|
||||
// Enter chapter selection activity (Confirm release, or a center touch-and-hold).
|
||||
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm) || ReaderUtils::isTouchMenuGesture(touch)) {
|
||||
if (xtc && xtc->hasChapters() && !xtc->getChapters().empty()) {
|
||||
startActivityForResult(
|
||||
std::make_unique<XtcReaderChapterSelectionActivity>(renderer, mappedInput, xtc, currentPage),
|
||||
@@ -79,11 +85,6 @@ void XtcReaderActivity::loop() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Touch reader controls mirror the side page buttons (left third = back,
|
||||
// right third = forward, press-and-hold = chapter skip). No-op on Xteink /
|
||||
// when the setting is off.
|
||||
const auto touch = ReaderUtils::detectTouchPageTurn(renderer);
|
||||
|
||||
auto [prevTriggered, nextTriggered, fromTilt] = ReaderUtils::detectPageTurn(mappedInput);
|
||||
prevTriggered = prevTriggered || touch.prev;
|
||||
nextTriggered = nextTriggered || touch.next;
|
||||
|
||||
Reference in New Issue
Block a user