Added [,] mappings for go 10 images back/forward
This commit is contained in:
parent
2f7bd169ea
commit
6fed8db854
17
main.c
17
main.c
@ -43,8 +43,7 @@ img_t img;
|
|||||||
win_t win;
|
win_t win;
|
||||||
|
|
||||||
const char **filenames;
|
const char **filenames;
|
||||||
unsigned int filecnt;
|
int filecnt, fileidx;
|
||||||
unsigned int fileidx;
|
|
||||||
|
|
||||||
unsigned char timeout;
|
unsigned char timeout;
|
||||||
|
|
||||||
@ -168,6 +167,20 @@ void on_keypress(XEvent *ev) {
|
|||||||
changed = 1;
|
changed = 1;
|
||||||
}
|
}
|
||||||
break;
|
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':
|
case 'g':
|
||||||
if (fileidx != 0) {
|
if (fileidx != 0) {
|
||||||
fileidx = 0;
|
fileidx = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user