[gimp] Bug 677987 - Don't allow to assign keybindings with arrow keys...



commit decc03ae04b042e627a1070591901728a8063c26
Author: Michael Natterer <mitch gimp org>
Date:   Thu Jul 26 18:33:05 2012 +0200

    Bug 677987 - Don't allow to assign keybindings with arrow keys...
    
    Disable assigning arrow-key bindings in gimpactionview.c

 app/widgets/gimpactionview.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/app/widgets/gimpactionview.c b/app/widgets/gimpactionview.c
index 72dcdef..f64a11f 100644
--- a/app/widgets/gimpactionview.c
+++ b/app/widgets/gimpactionview.c
@@ -23,6 +23,7 @@
 #include <string.h>
 
 #include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
 
 #include "libgimpbase/gimpbase.h"
 #include "libgimpwidgets/gimpwidgets.h"
@@ -760,7 +761,15 @@ gimp_action_view_accel_edited (GtkCellRendererAccel *accel,
   if (! accel_path)
     return;
 
-  if (! accel_key)
+  if (! accel_key ||
+
+      /* Don't allow arrow keys, they are all swallowed by the canvas
+       * and cannot be invoked anyway
+       */
+      accel_key == GDK_KEY_Left  ||
+      accel_key == GDK_KEY_Right ||
+      accel_key == GDK_KEY_Up    ||
+      accel_key == GDK_KEY_Down)
     {
       gimp_message_literal (view->manager->gimp,
 			    G_OBJECT (view), GIMP_MESSAGE_ERROR,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]