aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-01-20 16:04:34 +0100
committerBert <ber.t@gmx.com>2011-01-20 16:04:34 +0100
commit004f297ebb3043032661513f40a36c1cc915bc59 (patch)
tree6780041bbe5c5502fd49e563ee0fd699d8eb7fe4 /main.c
parent45db2881e26dd5e51c0e4142bdefa2d947292c80 (diff)
Go to next/previous image
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/main.c b/main.c
index cd68350..42cecb5 100644
--- a/main.c
+++ b/main.c
@@ -102,6 +102,20 @@ void on_keypress(XEvent *ev) {
case XK_q:
cleanup();
exit(0);
+ case XK_n:
+ case XK_space:
+ if (fileidx + 1 < options->filecnt) {
+ img_load(&img, options->filenames[++fileidx]);
+ img_display(&img, &win);
+ }
+ break;
+ case XK_p:
+ case XK_BackSpace:
+ if (fileidx > 0) {
+ img_load(&img, options->filenames[--fileidx]);
+ img_display(&img, &win);
+ }
+ break;
}
}