diff options
Diffstat (limited to 'src/keyevents.c')
-rw-r--r-- | src/keyevents.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/keyevents.c b/src/keyevents.c index 83fc358..4837c0b 100644 --- a/src/keyevents.c +++ b/src/keyevents.c @@ -110,6 +110,8 @@ void init_keyevents(void) { feh_set_kb(&keys.next_img , 0, XK_Right , 0, XK_n , 0, XK_space); feh_set_kb(&keys.jump_back , 0, XK_Page_Up , 0, XK_KP_Page_Up, 0, 0); feh_set_kb(&keys.jump_fwd , 0, XK_Page_Down , 0, XK_KP_Page_Down,0,0); + feh_set_kb(&keys.prev_dir , 0, XK_bracketleft, 0, 0 , 0, 0); + feh_set_kb(&keys.next_dir , 0, XK_bracketright, 0, 0 , 0, 0); feh_set_kb(&keys.jump_random,0, XK_z , 0, 0 , 0, 0); feh_set_kb(&keys.quit , 0, XK_Escape , 0, XK_q , 0, 0); feh_set_kb(&keys.close , 0, XK_x , 0, 0 , 0, 0); @@ -178,6 +180,7 @@ void init_keyevents(void) { *k1 = '\0'; *k2 = '\0'; *k3 = '\0'; + cur_kb = NULL; read = sscanf(line, "%31s %31s %31s %31s\n", (char *) &action, (char *) &k1, (char* ) &k2, (char *) &k3); @@ -221,6 +224,10 @@ void init_keyevents(void) { cur_kb = &keys.jump_back; else if (!strcmp(action, "jump_fwd")) cur_kb = &keys.jump_fwd; + else if (!strcmp(action, "prev_dir")) + cur_kb = &keys.prev_dir; + else if (!strcmp(action, "next_dir")) + cur_kb = &keys.next_dir; else if (!strcmp(action, "jump_random")) cur_kb = &keys.jump_random; else if (!strcmp(action, "quit")) @@ -531,6 +538,14 @@ void feh_event_handle_keypress(XEvent * ev) else if (winwid->type == WIN_TYPE_THUMBNAIL) feh_thumbnail_select_next(winwid, 10); } + else if (feh_is_kp(&keys.next_dir, keysym, state)) { + if (opt.slideshow) + slideshow_change_image(winwid, SLIDE_JUMP_NEXT_DIR, 1); + } + else if (feh_is_kp(&keys.prev_dir, keysym, state)) { + if (opt.slideshow) + slideshow_change_image(winwid, SLIDE_JUMP_PREV_DIR, 1); + } else if (feh_is_kp(&keys.quit, keysym, state)) { winwidget_destroy_all(); } @@ -612,14 +627,8 @@ void feh_event_handle_keypress(XEvent * ev) } else if (feh_is_kp(&keys.zoom_default, keysym, state)) { winwid->zoom = 1.0; - /* --scale-down will revert our operation if old_zoom == 1.0 */ - if (opt.scale_down) - winwid->old_zoom = 1.001; winwidget_center_image(winwid); winwidget_render_image(winwid, 0, 0); - /* --scale-down will also do weird stuff if zoom is 1.0 */ - if (opt.scale_down) - winwid->zoom = 1.001; } else if (feh_is_kp(&keys.zoom_fit, keysym, state)) { feh_calc_needed_zoom(&winwid->zoom, winwid->im_w, winwid->im_h, winwid->w, winwid->h); @@ -731,9 +740,8 @@ void feh_event_handle_keypress(XEvent * ev) break; } } - if (getenv("XINERAMA_SCREEN")) - curr_screen = xinerama_screen = - atoi(getenv("XINERAMA_SCREEN")); + if (opt.xinerama_index >= 0) + curr_screen = xinerama_screen = opt.xinerama_index; } #endif /* HAVE_LIBXINERAMA */ winwid->full_screen = !winwid->full_screen; |