]> git.street.me.uk Git - andy/viking.git/commitdiff
SF Bugs#109: Ctrl+Keypad+/- to Zoom In/Out respectively.
authorRob Norris <rw_norris@hotmail.com>
Tue, 29 Jul 2014 23:22:57 +0000 (00:22 +0100)
committerRob Norris <rw_norris@hotmail.com>
Fri, 1 Aug 2014 17:46:18 +0000 (18:46 +0100)
help/C/viking.xml
src/vikwindow.c

index 6733ec16b06d133a20af4aaf57a4e423914f2dba..088a225640ba6310c3e6a27635e9e41afead345e 100644 (file)
@@ -340,6 +340,8 @@ Then there are shortcuts specific to &appname; to switch projection modes, zoom
 <listitem><para><keycap>Ctrl+Right</keycap> Pan the viewport East</para></listitem>
 <listitem><para><keycap>Ctrl+Down</keycap> Pan the viewport South</para></listitem>
 <listitem><para><keycap>Ctrl+Left</keycap> Pan the viewport West</para></listitem>
+<listitem><para><keycap>Ctrl+Keypad+</keycap> Zoom In</para></listitem>
+<listitem><para><keycap>Ctrl+Keypad-</keycap> Zoom Out</para></listitem>
 <listitem><note><para>These work irrespective of the <xref linkend="tools"/> mode selected</para></note></listitem>
 </itemizedlist>
 For other combinations see the menu entry themselves.
index 4dd89127beacb9d258118a079f0fc0686af8445f..8e30c8c23060fc503cc616e7ea2b40f04461037b 100644 (file)
@@ -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 );