From 36d8ff00dd1d0f60d0a2afca519de979c67f1dce Mon Sep 17 00:00:00 2001 From: "jakob.stendahl" Date: Sun, 14 Jul 2024 10:21:23 +0200 Subject: Add some more options for navigating --- snotifc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'snotifc.c') diff --git a/snotifc.c b/snotifc.c index 2261755..ac1ba84 100644 --- a/snotifc.c +++ b/snotifc.c @@ -508,6 +508,18 @@ void curses_handle_input(DBusConnection* conn, int ch, int* start, int* selected (*start) = 0; clear(); break; + case CTRL('d'): + (*selected) += ((LINES - 1) / 2); + (*start) += ((LINES - 1) / 2); + if ((*selected) >= notifs->element_count) + (*selected) = notifs->element_count - 1; + if ((*start) >= notifs->element_count - LINES + 1) { + (*start) = notifs->element_count - LINES + 1; + } + if ((*start) < 0) + (*start) = 0; + clear(); + break; case KEY_PPAGE: (*selected) -= (LINES - 1); (*start) -= (LINES - 1); @@ -517,6 +529,15 @@ void curses_handle_input(DBusConnection* conn, int ch, int* start, int* selected (*start) = 0; clear(); break; + case CTRL('u'): + (*selected) -= ((LINES - 1) / 2); + (*start) -= ((LINES - 1) / 2); + if ((*selected) < 0) + (*selected) = 0; + if ((*start) < 0) + (*start) = 0; + clear(); + break; case 'G': (*selected) = notifs->element_count - 1; (*start) = notifs->element_count - LINES + 1; -- cgit v1.2.3