From: Rob Norris Date: Tue, 29 Jul 2014 23:22:57 +0000 (+0100) Subject: SF Bugs#109: Ctrl+Keypad+/- to Zoom In/Out respectively. X-Git-Url: https://git.street.me.uk/andy/viking.git/commitdiff_plain/f41c804a5210c37b0c950eb6ad6ae8addf08fd27 SF Bugs#109: Ctrl+Keypad+/- to Zoom In/Out respectively. --- diff --git a/help/C/viking.xml b/help/C/viking.xml index 6733ec16..088a2256 100644 --- a/help/C/viking.xml +++ b/help/C/viking.xml @@ -340,6 +340,8 @@ Then there are shortcuts specific to &appname; to switch projection modes, zoom Ctrl+Right Pan the viewport East Ctrl+Down Pan the viewport South Ctrl+Left Pan the viewport West +Ctrl+Keypad+ Zoom In +Ctrl+Keypad- Zoom Out These work irrespective of the mode selected For other combinations see the menu entry themselves. diff --git a/src/vikwindow.c b/src/vikwindow.c index 4dd89127..8e30c8c2 100644 --- a/src/vikwindow.c +++ b/src/vikwindow.c @@ -900,6 +900,17 @@ static gboolean key_press_event( VikWindow *vw, GdkEventKey *event, gpointer dat map_download = TRUE; map_download_only_new = FALSE; } + // Standard Ctrl+KP+ / Ctrl+KP- to zoom in/out respectively + else if ( event->keyval == GDK_KEY_KP_Add && (event->state & modifiers) == GDK_CONTROL_MASK ) { + vik_viewport_zoom_in ( vw->viking_vvp ); + draw_update(vw); + return TRUE; // handled keypress + } + else if ( event->keyval == GDK_KEY_KP_Subtract && (event->state & modifiers) == GDK_CONTROL_MASK ) { + vik_viewport_zoom_out ( vw->viking_vvp ); + draw_update(vw); + return TRUE; // handled keypress + } if ( map_download ) { simple_map_update ( vw, map_download_only_new );