From 101e1fa2e2e02857a095cd13916ad35ac60b1318 Mon Sep 17 00:00:00 2001 From: Laurent MAZET Date: Tue, 8 Oct 2024 14:44:35 +0200 Subject: [PATCH] support prev and next page keys --- ndisplay.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/ndisplay.c b/ndisplay.c index ac41fd2..614e363 100644 --- a/ndisplay.c +++ b/ndisplay.c @@ -285,6 +285,32 @@ int main (int argc, char *argv[]) change = 1; } break; + case KEY_PPAGE: + case 'I': + if (ycursor > 0) { + ycursor = max (0, ycursor - LINES / 2); + change = 1; + } + break; + case 'J': + if (xcursor > 0) { + xcursor = max (0, xcursor - COLS / 2); + change = 1; + } + break; + case KEY_NPAGE: + case 'K': + if (images[scale]->height - ycursor > LINES) { + ycursor = min (ycursor + LINES / 2, images[scale]->height - LINES); + change = 1; + } + break; + case 'L': + if (images[scale]->width - xcursor > COLS / mode) { + xcursor = min (xcursor + COLS / 2, images[scale]->width - COLS); + change = 1; + } + break; } } -- 2.30.2