Add touch-down and long-press input detection

Implement touch-down event detection to provide immediate visual feedback when touching list items, mirroring button navigation behavior. Add long-press detection (500ms threshold) to distinguish between tap and hold gestures. Apply touch-down selection updates to file browser, home menu, and recent books activities.
This commit is contained in:
Justin Mitchell committed 2026-06-15 16:12:07 -04:00
1 parent 9176e76f5a
commit d739827db2
23 files changed
+223 -33

No files matched your search

@@ -118,6 +118,14 @@ void SettingsActivity::loop() {
// A tap on a settings row selects + activates it in one gesture. The list is drawn
// with selectedIndex = selectedSettingIndex - 1 (row 0 is the category tab), so map
// the tapped 0-based row back by +1. (Category tab bar is tappable in a later phase.)
// Touch-down moves the selection to the pressed row (shows selected state); release
// toggles/activates it below. (Row 0 is the tab bar, so settings list id 0 -> index 1.)
int downId = -1;
if (mappedInput.wasItemTouchedDown(downId) && downId >= 0 && downId < settingsCount) {
selectedSettingIndex = downId + 1;
requestUpdate();
}
int tappedId = -1;
if (mappedInput.wasItemTapped(tappedId) && tappedId >= 0 && tappedId < settingsCount) {
selectedSettingIndex = tappedId + 1;
@@ -133,6 +141,7 @@ void SettingsActivity::loop() {
selectedCategoryIndex = tabId;
selectedSettingIndex = 0;
hasChangedCategory = true;
requestUpdate();
}
// Handle actions with early return