diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-08-27 12:42:54 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-08-27 12:42:54 +0200 |
commit | 75e1e83713a83cd98f05d35efcedd6ac041788da (patch) | |
tree | 24493781f046052f5140e0aa2dd8f752588ac8b8 /src | |
parent | 3b8253278ccfa01c18262a31b7e92181ad3ad345 (diff) |
Key actions can now also be bound to buttons. not vice versa, though
Diffstat (limited to 'src')
-rw-r--r-- | src/events.c | 135 | ||||
-rw-r--r-- | src/feh.h | 1 | ||||
-rw-r--r-- | src/keyevents.c | 154 |
3 files changed, 217 insertions, 73 deletions
diff --git a/src/events.c b/src/events.c index b0ebac0..6e4f256 100644 --- a/src/events.c +++ b/src/events.c @@ -101,7 +101,6 @@ void init_buttonbindings(void) FILE *conf = NULL; int read = 0; - feh_set_bb(&keys.reload, 0, 0); feh_set_bb(&keys.pan, 0, 1); feh_set_bb(&keys.zoom, 0, 2); feh_set_bb(&keys.menu, 0, 3); @@ -137,6 +136,11 @@ void init_buttonbindings(void) if ((read == EOF) || (read == 0) || (line[0] == '#')) continue; + /* + * Note: This isn't really good code. But it works, and since it only + * runs once for each button config line the runtime penalty compared to + * e.g. a hash table is negligible in this case. + */ if (!strcmp(action, "reload")) cur_bb = &keys.reload; else if (!strcmp(action, "pan")) @@ -157,6 +161,134 @@ void init_buttonbindings(void) cur_bb = &keys.zoom_in; else if (!strcmp(action, "zoom_out")) cur_bb = &keys.zoom_out; + else if (!strcmp(action, "menu_close")) + cur_bb = &keys.menu_close; + else if (!strcmp(action, "menu_parent")) + cur_bb = &keys.menu_parent; + else if (!strcmp(action, "menu_down")) + cur_bb = &keys.menu_down; + else if (!strcmp(action, "menu_up")) + cur_bb = &keys.menu_up; + else if (!strcmp(action, "menu_child")) + cur_bb = &keys.menu_child; + else if (!strcmp(action, "menu_select")) + cur_bb = &keys.menu_select; + else if (!strcmp(action, "scroll_right")) + cur_bb = &keys.scroll_right; + else if (!strcmp(action, "scroll_left")) + cur_bb = &keys.scroll_left; + else if (!strcmp(action, "scroll_up")) + cur_bb = &keys.scroll_up; + else if (!strcmp(action, "scroll_down")) + cur_bb = &keys.scroll_down; + else if (!strcmp(action, "scroll_right_page")) + cur_bb = &keys.scroll_right_page; + else if (!strcmp(action, "scroll_left_page")) + cur_bb = &keys.scroll_left_page; + else if (!strcmp(action, "scroll_up_page")) + cur_bb = &keys.scroll_up_page; + else if (!strcmp(action, "scroll_down_page")) + cur_bb = &keys.scroll_down_page; + else if (!strcmp(action, "prev_img")) + cur_bb = &keys.prev_img; + else if (!strcmp(action, "next_img")) + cur_bb = &keys.next_img; + else if (!strcmp(action, "jump_back")) + cur_bb = &keys.jump_back; + else if (!strcmp(action, "jump_fwd")) + cur_bb = &keys.jump_fwd; + else if (!strcmp(action, "prev_dir")) + cur_bb = &keys.prev_dir; + else if (!strcmp(action, "next_dir")) + cur_bb = &keys.next_dir; + else if (!strcmp(action, "jump_random")) + cur_bb = &keys.jump_random; + else if (!strcmp(action, "quit")) + cur_bb = &keys.quit; + else if (!strcmp(action, "close")) + cur_bb = &keys.close; + else if (!strcmp(action, "remove")) + cur_bb = &keys.remove; + else if (!strcmp(action, "delete")) + cur_bb = &keys.delete; + else if (!strcmp(action, "jump_first")) + cur_bb = &keys.jump_first; + else if (!strcmp(action, "jump_last")) + cur_bb = &keys.jump_last; + else if (!strcmp(action, "action_0")) + cur_bb = &keys.action_0; + else if (!strcmp(action, "action_1")) + cur_bb = &keys.action_1; + else if (!strcmp(action, "action_2")) + cur_bb = &keys.action_2; + else if (!strcmp(action, "action_3")) + cur_bb = &keys.action_3; + else if (!strcmp(action, "action_4")) + cur_bb = &keys.action_4; + else if (!strcmp(action, "action_5")) + cur_bb = &keys.action_5; + else if (!strcmp(action, "action_6")) + cur_bb = &keys.action_6; + else if (!strcmp(action, "action_7")) + cur_bb = &keys.action_7; + else if (!strcmp(action, "action_8")) + cur_bb = &keys.action_8; + else if (!strcmp(action, "action_9")) + cur_bb = &keys.action_9; + else if (!strcmp(action, "zoom_in")) + cur_bb = &keys.zoom_in; + else if (!strcmp(action, "zoom_out")) + cur_bb = &keys.zoom_out; + else if (!strcmp(action, "zoom_default")) + cur_bb = &keys.zoom_default; + else if (!strcmp(action, "zoom_fit")) + cur_bb = &keys.zoom_fit; + else if (!strcmp(action, "size_to_image")) + cur_bb = &keys.size_to_image; + else if (!strcmp(action, "render")) + cur_bb = &keys.render; + else if (!strcmp(action, "toggle_actions")) + cur_bb = &keys.toggle_actions; + else if (!strcmp(action, "toggle_aliasing")) + cur_bb = &keys.toggle_aliasing; + else if (!strcmp(action, "toggle_filenames")) + cur_bb = &keys.toggle_filenames; +#ifdef HAVE_LIBEXIF + else if (!strcmp(action, "toggle_exif")) + cur_bb = &keys.toggle_exif; +#endif + else if (!strcmp(action, "toggle_info")) + cur_bb = &keys.toggle_info; + else if (!strcmp(action, "toggle_pointer")) + cur_bb = &keys.toggle_pointer; + else if (!strcmp(action, "toggle_caption")) + cur_bb = &keys.toggle_caption; + else if (!strcmp(action, "toggle_pause")) + cur_bb = &keys.toggle_pause; + else if (!strcmp(action, "toggle_menu")) + cur_bb = &keys.toggle_menu; + else if (!strcmp(action, "toggle_fullscreen")) + cur_bb = &keys.toggle_fullscreen; + else if (!strcmp(action, "reload_image")) + cur_bb = &keys.reload_image; + else if (!strcmp(action, "save_image")) + cur_bb = &keys.save_image; + else if (!strcmp(action, "save_filelist")) + cur_bb = &keys.save_filelist; + else if (!strcmp(action, "orient_1")) + cur_bb = &keys.orient_1; + else if (!strcmp(action, "orient_3")) + cur_bb = &keys.orient_3; + else if (!strcmp(action, "flip")) + cur_bb = &keys.flip; + else if (!strcmp(action, "mirror")) + cur_bb = &keys.mirror; + else if (!strcmp(action, "reload_minus")) + cur_bb = &keys.reload_minus; + else if (!strcmp(action, "reload_plus")) + cur_bb = &keys.reload_plus; + else if (!strcmp(action, "toggle_keep_vp")) + cur_bb = &keys.toggle_keep_vp; else weprintf("buttons: Invalid action: %s", action); @@ -323,6 +455,7 @@ static void feh_event_handle_ButtonPress(XEvent * ev) } else { D(("Received other ButtonPress event\n")); + feh_event_handle_generic(winwid, state, NoSymbol, button); } return; } @@ -141,6 +141,7 @@ char *slideshow_create_name(feh_file * file, winwidget winwid); void init_keyevents(void); void init_buttonbindings(void); void feh_event_handle_keypress(XEvent * ev); +void feh_event_handle_generic(winwidget winwid, unsigned int state, KeySym keysym, unsigned int button); void feh_action_run(feh_file * file, char *action); char *format_size(int size); char *feh_printf(char *str, feh_file * file, winwidget winwid); diff --git a/src/keyevents.c b/src/keyevents.c index 61a6a0a..012e79c 100644 --- a/src/keyevents.c +++ b/src/keyevents.c @@ -329,16 +329,22 @@ void init_keyevents(void) { fclose(conf); } -static short feh_is_kp(fehkey *key, unsigned int sym, unsigned int state) { +static short feh_is_kp(fehkey *key, unsigned int state, unsigned int sym, unsigned int button) { int i; - for (i = 0; i < 3; i++) { - if ( - (key->keysyms[i] == sym) && - (key->keystates[i] == state)) - return 1; - else if (key->keysyms[i] == 0) - return 0; + if (sym != NoSymbol) { + for (i = 0; i < 3; i++) { + if ( + (key->keysyms[i] == sym) && + (key->keystates[i] == state)) + return 1; + else if (key->keysyms[i] == 0) + return 0; + } + return 0; + } + if ((key->state == state) && (key->button == button)) { + return 1; } return 0; } @@ -384,7 +390,6 @@ void feh_event_handle_keypress(XEvent * ev) KeySym keysym; XKeyEvent *kev; winwidget winwid = NULL; - int curr_screen = 0; feh_menu_item *selected_item; feh_menu *selected_menu; @@ -405,17 +410,17 @@ void feh_event_handle_keypress(XEvent * ev) /* menus are showing, so this is a menu control keypress */ if (ev->xbutton.window == menu_cover) { selected_item = feh_menu_find_selected_r(menu_root, &selected_menu); - if (feh_is_kp(&keys.menu_close, keysym, state)) + if (feh_is_kp(&keys.menu_close, state, keysym, 0)) feh_menu_hide(menu_root, True); - else if (feh_is_kp(&keys.menu_parent, keysym, state)) + else if (feh_is_kp(&keys.menu_parent, state, keysym, 0)) feh_menu_select_parent(selected_menu); - else if (feh_is_kp(&keys.menu_down, keysym, state)) + else if (feh_is_kp(&keys.menu_down, state, keysym, 0)) feh_menu_select_next(selected_menu, selected_item); - else if (feh_is_kp(&keys.menu_up, keysym, state)) + else if (feh_is_kp(&keys.menu_up, state, keysym, 0)) feh_menu_select_prev(selected_menu, selected_item); - else if (feh_is_kp(&keys.menu_child, keysym, state)) + else if (feh_is_kp(&keys.menu_child, state, keysym, 0)) feh_menu_select_submenu(selected_menu); - else if (feh_is_kp(&keys.menu_select, keysym, state)) + else if (feh_is_kp(&keys.menu_select, state, keysym, 0)) feh_menu_item_activate(selected_menu, selected_item); return; } @@ -474,131 +479,136 @@ void feh_event_handle_keypress(XEvent * ev) } return; } + feh_event_handle_generic(winwid, state, keysym, 0); +} + +void feh_event_handle_generic(winwidget winwid, unsigned int state, KeySym keysym, unsigned int button) { + int curr_screen = 0; - if (feh_is_kp(&keys.next_img, keysym, state)) { + if (feh_is_kp(&keys.next_img, state, keysym, button)) { if (opt.slideshow) slideshow_change_image(winwid, SLIDE_NEXT, 1); else if (winwid->type == WIN_TYPE_THUMBNAIL) feh_thumbnail_select_next(winwid, 1); } - else if (feh_is_kp(&keys.prev_img, keysym, state)) { + else if (feh_is_kp(&keys.prev_img, state, keysym, button)) { if (opt.slideshow) slideshow_change_image(winwid, SLIDE_PREV, 1); else if (winwid->type == WIN_TYPE_THUMBNAIL) feh_thumbnail_select_prev(winwid, 1); } - else if (feh_is_kp(&keys.scroll_right, keysym, state)) { + else if (feh_is_kp(&keys.scroll_right, state, keysym, button)) { winwid->im_x -= opt.scroll_step;; winwidget_sanitise_offsets(winwid); winwidget_render_image(winwid, 0, 1); } - else if (feh_is_kp(&keys.scroll_left, keysym, state)) { + else if (feh_is_kp(&keys.scroll_left, state, keysym, button)) { winwid->im_x += opt.scroll_step; winwidget_sanitise_offsets(winwid); winwidget_render_image(winwid, 0, 1); } - else if (feh_is_kp(&keys.scroll_down, keysym, state)) { + else if (feh_is_kp(&keys.scroll_down, state, keysym, button)) { winwid->im_y -= opt.scroll_step; winwidget_sanitise_offsets(winwid); winwidget_render_image(winwid, 0, 1); } - else if (feh_is_kp(&keys.scroll_up, keysym, state)) { + else if (feh_is_kp(&keys.scroll_up, state, keysym, button)) { winwid->im_y += opt.scroll_step; winwidget_sanitise_offsets(winwid); winwidget_render_image(winwid, 0, 1); } - else if (feh_is_kp(&keys.scroll_right_page, keysym, state)) { + else if (feh_is_kp(&keys.scroll_right_page, state, keysym, button)) { winwid->im_x -= winwid->w; winwidget_sanitise_offsets(winwid); winwidget_render_image(winwid, 0, 0); } - else if (feh_is_kp(&keys.scroll_left_page, keysym, state)) { + else if (feh_is_kp(&keys.scroll_left_page, state, keysym, button)) { winwid->im_x += winwid->w; winwidget_sanitise_offsets(winwid); winwidget_render_image(winwid, 0, 0); } - else if (feh_is_kp(&keys.scroll_down_page, keysym, state)) { + else if (feh_is_kp(&keys.scroll_down_page, state, keysym, button)) { winwid->im_y -= winwid->h; winwidget_sanitise_offsets(winwid); winwidget_render_image(winwid, 0, 0); } - else if (feh_is_kp(&keys.scroll_up_page, keysym, state)) { + else if (feh_is_kp(&keys.scroll_up_page, state, keysym, button)) { winwid->im_y += winwid->h; winwidget_sanitise_offsets(winwid); winwidget_render_image(winwid, 0, 0); } - else if (feh_is_kp(&keys.jump_back, keysym, state)) { + else if (feh_is_kp(&keys.jump_back, state, keysym, button)) { if (opt.slideshow) slideshow_change_image(winwid, SLIDE_JUMP_BACK, 1); else if (winwid->type == WIN_TYPE_THUMBNAIL) feh_thumbnail_select_prev(winwid, 10); } - else if (feh_is_kp(&keys.jump_fwd, keysym, state)) { + else if (feh_is_kp(&keys.jump_fwd, state, keysym, button)) { if (opt.slideshow) slideshow_change_image(winwid, SLIDE_JUMP_FWD, 1); else if (winwid->type == WIN_TYPE_THUMBNAIL) feh_thumbnail_select_next(winwid, 10); } - else if (feh_is_kp(&keys.next_dir, keysym, state)) { + else if (feh_is_kp(&keys.next_dir, state, keysym, button)) { if (opt.slideshow) slideshow_change_image(winwid, SLIDE_JUMP_NEXT_DIR, 1); } - else if (feh_is_kp(&keys.prev_dir, keysym, state)) { + else if (feh_is_kp(&keys.prev_dir, state, keysym, button)) { if (opt.slideshow) slideshow_change_image(winwid, SLIDE_JUMP_PREV_DIR, 1); } - else if (feh_is_kp(&keys.quit, keysym, state)) { + else if (feh_is_kp(&keys.quit, state, keysym, button)) { winwidget_destroy_all(); } - else if (feh_is_kp(&keys.delete, keysym, state)) { + else if (feh_is_kp(&keys.delete, state, keysym, button)) { if (winwid->type == WIN_TYPE_THUMBNAIL_VIEWER) feh_thumbnail_mark_removed(FEH_FILE(winwid->file->data), 1); feh_filelist_image_remove(winwid, 1); } - else if (feh_is_kp(&keys.remove, keysym, state)) { + else if (feh_is_kp(&keys.remove, state, keysym, button)) { if (winwid->type == WIN_TYPE_THUMBNAIL_VIEWER) feh_thumbnail_mark_removed(FEH_FILE(winwid->file->data), 0); feh_filelist_image_remove(winwid, 0); } - else if (feh_is_kp(&keys.jump_first, keysym, state)) { + else if (feh_is_kp(&keys.jump_first, state, keysym, button)) { if (opt.slideshow) slideshow_change_image(winwid, SLIDE_FIRST, 1); } - else if (feh_is_kp(&keys.jump_last, keysym, state)) { + else if (feh_is_kp(&keys.jump_last, state, keysym, button)) { if (opt.slideshow) slideshow_change_image(winwid, SLIDE_LAST, 1); } - else if (feh_is_kp(&keys.action_0, keysym, state)) { + else if (feh_is_kp(&keys.action_0, state, keysym, button)) { feh_event_invoke_action(winwid, 0); } - else if (feh_is_kp(&keys.action_1, keysym, state)) { + else if (feh_is_kp(&keys.action_1, state, keysym, button)) { feh_event_invoke_action(winwid, 1); } - else if (feh_is_kp(&keys.action_2, keysym, state)) { + else if (feh_is_kp(&keys.action_2, state, keysym, button)) { feh_event_invoke_action(winwid, 2); } - else if (feh_is_kp(&keys.action_3, keysym, state)) { + else if (feh_is_kp(&keys.action_3, state, keysym, button)) { feh_event_invoke_action(winwid, 3); } - else if (feh_is_kp(&keys.action_4, keysym, state)) { + else if (feh_is_kp(&keys.action_4, state, keysym, button)) { feh_event_invoke_action(winwid, 4); } - else if (feh_is_kp(&keys.action_5, keysym, state)) { + else if (feh_is_kp(&keys.action_5, state, keysym, button)) { feh_event_invoke_action(winwid, 5); } - else if (feh_is_kp(&keys.action_6, keysym, state)) { + else if (feh_is_kp(&keys.action_6, state, keysym, button)) { feh_event_invoke_action(winwid, 6); } - else if (feh_is_kp(&keys.action_7, keysym, state)) { + else if (feh_is_kp(&keys.action_7, state, keysym, button)) { feh_event_invoke_action(winwid, 7); } - else if (feh_is_kp(&keys.action_8, keysym, state)) { + else if (feh_is_kp(&keys.action_8, state, keysym, button)) { feh_event_invoke_action(winwid, 8); } - else if (feh_is_kp(&keys.action_9, keysym, state)) { + else if (feh_is_kp(&keys.action_9, state, keysym, button)) { feh_event_invoke_action(winwid, 9); } - else if (feh_is_kp(&keys.zoom_in, keysym, state)) { + else if (feh_is_kp(&keys.zoom_in, state, keysym, button)) { winwid->old_zoom = winwid->zoom; winwid->zoom = winwid->zoom * 1.25; @@ -612,7 +622,7 @@ void feh_event_handle_keypress(XEvent * ev) winwidget_sanitise_offsets(winwid); winwidget_render_image(winwid, 0, 0); } - else if (feh_is_kp(&keys.zoom_out, keysym, state)) { + else if (feh_is_kp(&keys.zoom_out, state, keysym, button)) { winwid->old_zoom = winwid->zoom; winwid->zoom = winwid->zoom * 0.80; @@ -626,56 +636,56 @@ void feh_event_handle_keypress(XEvent * ev) winwidget_sanitise_offsets(winwid); winwidget_render_image(winwid, 0, 0); } - else if (feh_is_kp(&keys.zoom_default, keysym, state)) { + else if (feh_is_kp(&keys.zoom_default, state, keysym, button)) { winwid->zoom = 1.0; winwidget_center_image(winwid); winwidget_render_image(winwid, 0, 0); } - else if (feh_is_kp(&keys.zoom_fit, keysym, state)) { + else if (feh_is_kp(&keys.zoom_fit, state, keysym, button)) { feh_calc_needed_zoom(&winwid->zoom, winwid->im_w, winwid->im_h, winwid->w, winwid->h); winwidget_center_image(winwid); winwidget_render_image(winwid, 0, 0); } - else if (feh_is_kp(&keys.render, keysym, state)) { + else if (feh_is_kp(&keys.render, state, keysym, button)) { if (winwid->type == WIN_TYPE_THUMBNAIL) feh_thumbnail_show_selected(); else winwidget_render_image(winwid, 0, 0); } - else if (feh_is_kp(&keys.toggle_actions, keysym, state)) { + else if (feh_is_kp(&keys.toggle_actions, state, keysym, button)) { opt.draw_actions = !opt.draw_actions; winwidget_rerender_all(0); } - else if (feh_is_kp(&keys.toggle_aliasing, keysym, state)) { + else if (feh_is_kp(&keys.toggle_aliasing, state, keysym, button)) { opt.force_aliasing = !opt.force_aliasing; winwid->force_aliasing = !winwid->force_aliasing; winwidget_render_image(winwid, 0, 0); } - else if (feh_is_kp(&keys.toggle_filenames, keysym, state)) { + else if (feh_is_kp(&keys.toggle_filenames, state, keysym, button)) { opt.draw_filename = !opt.draw_filename; winwidget_rerender_all(0); } #ifdef HAVE_LIBEXIF - else if (feh_is_kp(&keys.toggle_exif, keysym, state)) { + else if (feh_is_kp(&keys.toggle_exif, state, keysym, button)) { opt.draw_exif = !opt.draw_exif; winwidget_rerender_all(0); } #endif - else if (feh_is_kp(&keys.toggle_info, keysym, state)) { + else if (feh_is_kp(&keys.toggle_info, state, keysym, button)) { opt.draw_info = !opt.draw_info; winwidget_rerender_all(0); } - else if (feh_is_kp(&keys.toggle_pointer, keysym, state)) { + else if (feh_is_kp(&keys.toggle_pointer, state, keysym, button)) { winwidget_set_pointer(winwid, opt.hide_pointer); opt.hide_pointer = !opt.hide_pointer; } - else if (feh_is_kp(&keys.jump_random, keysym, state)) { + else if (feh_is_kp(&keys.jump_random, state, keysym, button)) { if (winwid->type == WIN_TYPE_THUMBNAIL) feh_thumbnail_select_next(winwid, rand() % (filelist_len - 1)); else slideshow_change_image(winwid, SLIDE_RAND, 1); } - else if (feh_is_kp(&keys.toggle_caption, keysym, state)) { + else if (feh_is_kp(&keys.toggle_caption, state, keysym, button)) { if (opt.caption_path) { /* * editing captions in slideshow mode does not make any sense @@ -687,44 +697,44 @@ void feh_event_handle_keypress(XEvent * ev) } winwidget_render_image(winwid, 0, 0); } - else if (feh_is_kp(&keys.reload_image, keysym, state)) { + else if (feh_is_kp(&keys.reload_image, state, keysym, button)) { feh_reload_image(winwid, 0, 0); } - else if (feh_is_kp(&keys.toggle_pause, keysym, state)) { + else if (feh_is_kp(&keys.toggle_pause, state, keysym, button)) { slideshow_pause_toggle(winwid); } - else if (feh_is_kp(&keys.save_image, keysym, state)) { + else if (feh_is_kp(&keys.save_image, state, keysym, button)) { slideshow_save_image(winwid); } - else if (feh_is_kp(&keys.save_filelist, keysym, state)) { + else if (feh_is_kp(&keys.save_filelist, state, keysym, button)) { if ((winwid->type == WIN_TYPE_THUMBNAIL) || (winwid->type == WIN_TYPE_THUMBNAIL_VIEWER)) weprintf("Filelist saving is not supported in thumbnail mode"); else feh_save_filelist(); } - else if (feh_is_kp(&keys.size_to_image, keysym, state)) { + else if (feh_is_kp(&keys.size_to_image, state, keysym, button)) { winwidget_size_to_image(winwid); } - else if (feh_is_kp(&keys.toggle_menu, keysym, state)) { + else if (feh_is_kp(&keys.toggle_menu, state, keysym, button)) { winwidget_show_menu(winwid); } - else if (feh_is_kp(&keys.close, keysym, state)) { + else if (feh_is_kp(&keys.close, state, keysym, button)) { winwidget_destroy(winwid); } - else if (feh_is_kp(&keys.orient_1, keysym, state)) { + else if (feh_is_kp(&keys.orient_1, state, keysym, button)) { feh_edit_inplace(winwid, 1); } - else if (feh_is_kp(&keys.orient_3, keysym, state)) { + else if (feh_is_kp(&keys.orient_3, state, keysym, button)) { feh_edit_inplace(winwid, 3); } - else if (feh_is_kp(&keys.flip, keysym, state)) { + else if (feh_is_kp(&keys.flip, state, keysym, button)) { feh_edit_inplace(winwid, INPLACE_EDIT_FLIP); } - else if (feh_is_kp(&keys.mirror, keysym, state)) { + else if (feh_is_kp(&keys.mirror, state, keysym, button)) { feh_edit_inplace(winwid, INPLACE_EDIT_MIRROR); } - else if (feh_is_kp(&keys.toggle_fullscreen, keysym, state)) { + else if (feh_is_kp(&keys.toggle_fullscreen, state, keysym, button)) { #ifdef HAVE_LIBXINERAMA if (opt.xinerama && xinerama_screens) { int i, rect[4]; @@ -760,19 +770,19 @@ void feh_event_handle_keypress(XEvent * ev) } #endif /* HAVE_LIBXINERAMA */ } - else if (feh_is_kp(&keys.reload_plus, keysym, state)){ + else if (feh_is_kp(&keys.reload_plus, state, keysym, button)){ if (opt.reload < SLIDESHOW_RELOAD_MAX) opt.reload++; else if (opt.verbose) weprintf("Cannot set RELOAD higher than %f seconds.", opt.reload); } - else if (feh_is_kp(&keys.reload_minus, keysym, state)) { + else if (feh_is_kp(&keys.reload_minus, state, keysym, button)) { if (opt.reload > 1) opt.reload--; else if (opt.verbose) weprintf("Cannot set RELOAD lower than 1 second."); } - else if (feh_is_kp(&keys.toggle_keep_vp, keysym, state)) { + else if (feh_is_kp(&keys.toggle_keep_vp, state, keysym, button)) { opt.keep_zoom_vp = !opt.keep_zoom_vp; } return; |