summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/list.c22
-rw-r--r--apps/gui/list.h4
2 files changed, 26 insertions, 0 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c
index c53a1f5..d1b2748 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -576,6 +576,25 @@ static void gui_synclist_scroll_left(struct gui_synclist * lists)
}
#endif /* HAVE_LCD_BITMAP */
+#if CONFIG_CODEC == SWCODEC
+bool gui_synclist_keyclick_callback(int action, void* data)
+{
+ struct gui_synclist *lists = (struct gui_synclist *)data;
+
+ /* block the beep if we are at the end of the list and we are not wrapping.
+ * CAVEAT: mosts lists don't set limit_scroll untill it sees a repeat
+ * press at the end of the list so this can cause an extra beep.
+ */
+ if (lists->limit_scroll == false)
+ return true;
+ if (lists->selected_item == 0)
+ return (action != ACTION_STD_PREV && action != ACTION_STD_PREVREPEAT);
+ if (lists->selected_item == lists->nb_items - lists->selected_size)
+ return (action != ACTION_STD_NEXT && action != ACTION_STD_NEXTREPEAT);
+
+ return action != ACTION_NONE;
+}
+#endif
bool gui_synclist_do_button(struct gui_synclist * lists,
int *actionptr, enum list_wrap wrap)
@@ -774,6 +793,9 @@ bool list_do_action(int context, int timeout,
do_button, and places the action from get_action in *action. */
{
timeout = list_do_action_timeout(lists, timeout);
+#if CONFIG_CODEC == SWCODEC
+ keyclick_set_callback(gui_synclist_keyclick_callback, lists);
+#endif
*action = get_action(context, timeout);
return gui_synclist_do_button(lists, action, wrap);
}
diff --git a/apps/gui/list.h b/apps/gui/list.h
index c536046..d9df008 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -165,6 +165,10 @@ extern void gui_synclist_set_title(struct gui_synclist * lists, char * title,
enum themable_icons icon);
extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists,
bool hide);
+
+#if CONFIG_CODEC == SWCODEC
+extern bool gui_synclist_keyclick_callback(int action, void* data);
+#endif
/*
* Do the action implied by the given button,
* returns true if the action was handled.