From 75089ff54356601a43fb15898041363a115df89f Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 17 Jun 2022 10:17:39 +0300 Subject: [PATCH 27/27] gtk: Make numpad keys to work for controlling zoom Reported by elefant See osdn #44846 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.0/gui_main.c | 2 ++ client/gui-gtk-3.22/gui_main.c | 2 ++ client/gui-gtk-4.0/gui_main.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/client/gui-gtk-3.0/gui_main.c b/client/gui-gtk-3.0/gui_main.c index b3584be790..cab1f44ef8 100644 --- a/client/gui-gtk-3.0/gui_main.c +++ b/client/gui-gtk-3.0/gui_main.c @@ -450,10 +450,12 @@ static gboolean key_press_map_canvas(GtkWidget *w, GdkEventKey *ev, if (!(ev->state & GDK_CONTROL_MASK)) { switch (ev->keyval) { case GDK_KEY_plus: + case GDK_KEY_KP_Add: zoom_step_up(); return TRUE; case GDK_KEY_minus: + case GDK_KEY_KP_Subtract: zoom_step_down(); return TRUE; diff --git a/client/gui-gtk-3.22/gui_main.c b/client/gui-gtk-3.22/gui_main.c index d4b5dad019..1f4f88d137 100644 --- a/client/gui-gtk-3.22/gui_main.c +++ b/client/gui-gtk-3.22/gui_main.c @@ -429,10 +429,12 @@ static gboolean key_press_map_canvas(GtkWidget *w, GdkEventKey *ev, if (!(ev->state & GDK_CONTROL_MASK)) { switch (ev->keyval) { case GDK_KEY_plus: + case GDK_KEY_KP_Add: zoom_step_up(); return TRUE; case GDK_KEY_minus: + case GDK_KEY_KP_Subtract: zoom_step_down(); return TRUE; diff --git a/client/gui-gtk-4.0/gui_main.c b/client/gui-gtk-4.0/gui_main.c index 3aa6fab560..0be2a35fd2 100644 --- a/client/gui-gtk-4.0/gui_main.c +++ b/client/gui-gtk-4.0/gui_main.c @@ -397,10 +397,12 @@ static gboolean key_press_map_canvas(guint keyval, GdkModifierType state) if (!(state & GDK_CONTROL_MASK)) { switch (keyval) { case GDK_KEY_plus: + case GDK_KEY_KP_Add: zoom_step_up(); return TRUE; case GDK_KEY_minus: + case GDK_KEY_KP_Subtract: zoom_step_down(); return TRUE; -- 2.35.1