mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 22:57:50 +03:00
Fix input leakage: use wasReleased for action buttons in Menu and Footnotes
This commit is contained in:
parent
2ad75f3ebe
commit
9a8aeee5ae
@ -16,12 +16,12 @@ void EpubReaderFootnotesActivity::onExit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EpubReaderFootnotesActivity::loop() {
|
void EpubReaderFootnotesActivity::loop() {
|
||||||
if (mappedInput.wasPressed(MappedInputManager::Button::Back)) {
|
if (mappedInput.wasReleased(MappedInputManager::Button::Back)) {
|
||||||
onGoBack();
|
onGoBack();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mappedInput.wasPressed(MappedInputManager::Button::Confirm)) {
|
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
|
||||||
const FootnoteEntry* entry = footnotes.getEntry(selectedIndex);
|
const FootnoteEntry* entry = footnotes.getEntry(selectedIndex);
|
||||||
if (entry) {
|
if (entry) {
|
||||||
Serial.printf("[%lu] [FNS] Selected footnote: %s -> %s\n", millis(), entry->number, entry->href);
|
Serial.printf("[%lu] [FNS] Selected footnote: %s -> %s\n", millis(), entry->number, entry->href);
|
||||||
|
|||||||
@ -44,9 +44,9 @@ void EpubReaderMenuActivity::loop() {
|
|||||||
const bool nextReleased =
|
const bool nextReleased =
|
||||||
mappedInput.wasReleased(MappedInputManager::Button::Down) || mappedInput.wasReleased(MappedInputManager::Button::Right);
|
mappedInput.wasReleased(MappedInputManager::Button::Down) || mappedInput.wasReleased(MappedInputManager::Button::Right);
|
||||||
|
|
||||||
if (mappedInput.wasPressed(MappedInputManager::Button::Confirm)) {
|
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
|
||||||
onSelectOption(static_cast<MenuOption>(selectorIndex));
|
onSelectOption(static_cast<MenuOption>(selectorIndex));
|
||||||
} else if (mappedInput.wasPressed(MappedInputManager::Button::Back)) {
|
} else if (mappedInput.wasReleased(MappedInputManager::Button::Back)) {
|
||||||
onGoBack();
|
onGoBack();
|
||||||
} else if (prevReleased) {
|
} else if (prevReleased) {
|
||||||
selectorIndex = (selectorIndex + MENU_ITEMS_COUNT - 1) % MENU_ITEMS_COUNT;
|
selectorIndex = (selectorIndex + MENU_ITEMS_COUNT - 1) % MENU_ITEMS_COUNT;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user