diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-02-28 20:06:33 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-02-28 20:06:33 +0100 |
commit | d03fc61a268048e1bcef04fb00883c6cd339027b (patch) | |
tree | a69921e4b44d63710f396eab5cdc6fd0c12cfcb4 /src | |
parent | 81656da71b514d3519c9930d26e100f12da65a49 (diff) |
Add toggle_auto_zoom key binding, defaulting to Z
Closes #218
Diffstat (limited to 'src')
-rw-r--r-- | src/keyevents.c | 5 | ||||
-rw-r--r-- | src/options.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/keyevents.c b/src/keyevents.c index f082a78..793767b 100644 --- a/src/keyevents.c +++ b/src/keyevents.c @@ -185,6 +185,7 @@ void init_keyevents(void) { feh_set_kb("render" , 0, XK_KP_Begin , 0, XK_R , 0, 0); feh_set_kb("toggle_actions" , 0, XK_a, 0, 0, 0, 0); feh_set_kb("toggle_aliasing" , 0, XK_A, 0, 0, 0, 0); + feh_set_kb("toggle_auto_zoom" , 0, XK_Z, 0, 0, 0, 0); #ifdef HAVE_LIBEXIF feh_set_kb("toggle_exif" , 0, XK_e, 0, 0, 0, 0); #endif @@ -637,6 +638,10 @@ void feh_event_handle_generic(winwidget winwid, unsigned int state, KeySym keysy winwid->force_aliasing = !winwid->force_aliasing; winwidget_render_image(winwid, 0, 0); } + else if (feh_is_kp(EVENT_toggle_auto_zoom, state, keysym, button)) { + opt.zoom_mode = (opt.zoom_mode == 0 ? ZOOM_MODE_MAX : 0); + winwidget_rerender_all(1); + } else if (feh_is_kp(EVENT_toggle_filenames, state, keysym, button)) { opt.draw_filename = !opt.draw_filename; winwidget_rerender_all(0); diff --git a/src/options.h b/src/options.h index c6b4e0e..d4de3c5 100644 --- a/src/options.h +++ b/src/options.h @@ -189,6 +189,7 @@ enum key_action { EVENT_render, EVENT_toggle_actions, EVENT_toggle_aliasing, + EVENT_toggle_auto_zoom, #ifdef HAVE_LIBEXIF EVENT_toggle_exif, #endif |