mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +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() {
|
||||
if (mappedInput.wasPressed(MappedInputManager::Button::Back)) {
|
||||
if (mappedInput.wasReleased(MappedInputManager::Button::Back)) {
|
||||
onGoBack();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mappedInput.wasPressed(MappedInputManager::Button::Confirm)) {
|
||||
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
|
||||
const FootnoteEntry* entry = footnotes.getEntry(selectedIndex);
|
||||
if (entry) {
|
||||
Serial.printf("[%lu] [FNS] Selected footnote: %s -> %s\n", millis(), entry->number, entry->href);
|
||||
|
||||
@ -44,9 +44,9 @@ void EpubReaderMenuActivity::loop() {
|
||||
const bool nextReleased =
|
||||
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));
|
||||
} else if (mappedInput.wasPressed(MappedInputManager::Button::Back)) {
|
||||
} else if (mappedInput.wasReleased(MappedInputManager::Button::Back)) {
|
||||
onGoBack();
|
||||
} else if (prevReleased) {
|
||||
selectorIndex = (selectorIndex + MENU_ITEMS_COUNT - 1) % MENU_ITEMS_COUNT;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user