diff options
author | Bert <ber.t@gmx.com> | 2011-01-23 12:36:27 +0100 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-01-23 12:36:27 +0100 |
commit | 6fed8db854888381a1d436b76fb9ec3df95763a0 (patch) | |
tree | 10f7b0a592b26aaaf438055ccc69fa4bd724c237 /main.c | |
parent | 2f7bd169ea07be3b7f9cbcebfd9dc2082d9edd47 (diff) | |
download | nsxiv-6fed8db854888381a1d436b76fb9ec3df95763a0.tar.zst |
Added [,] mappings for go 10 images back/forward
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -43,8 +43,7 @@ img_t img; win_t win; const char **filenames; -unsigned int filecnt; -unsigned int fileidx; +int filecnt, fileidx; unsigned char timeout; @@ -168,6 +167,20 @@ void on_keypress(XEvent *ev) { changed = 1; } break; + case '[': + if (fileidx != 0) { + fileidx = MAX(0, fileidx - 10); + img_load(&img, filenames[fileidx]); + changed = 1; + } + break; + case ']': + if (fileidx != filecnt - 1) { + fileidx = MIN(fileidx + 10, filecnt - 1); + img_load(&img, filenames[fileidx]); + changed = 1; + } + break; case 'g': if (fileidx != 0) { fileidx = 0; |