Added [,] mappings for go 10 images back/forward

master
Bert 2011-01-23 12:36:27 +01:00
parent 2f7bd169ea
commit 6fed8db854
2 changed files with 16 additions and 3 deletions

17
main.c
View File

@ -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;

View File

@ -21,7 +21,7 @@
typedef struct options_s {
const char **filenames;
unsigned int filecnt;
int filecnt;
} options_t;
extern const options_t *options;