]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
make it work with older Gtk again
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Wed, 25 Mar 2009 11:49:50 +0000 (11:49 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Wed, 25 Mar 2009 11:49:50 +0000 (11:49 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@229 61c419a2-8eb2-4b30-bcec-8cead039b335

libs/gtkutil/accelerator.h
radiant/commands.cpp

index 1e682b571c0f00ccfdd907cf859526f76b8a3641..4e441b2115fc9ae4e3e36b959bf4df829f3ef158 100644 (file)
@@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "generic/callback.h"
 
 // ignore numlock
-#define ALLOWED_MODIFIERS (~(GDK_MOD2_MASK | GDK_LOCK_MASK))
+#define ALLOWED_MODIFIERS (~(GDK_MOD2_MASK | GDK_LOCK_MASK | GDK_MOD3_MASK | GDK_MOD4_MASK | GDK_MOD5_MASK))
 
 struct Accelerator
 {
index a676a631f1528e2b46a2615fe8e25869b45d4828..3172068680471a489ee09e2b2dc625d586dcd5ab 100644 (file)
@@ -263,8 +263,31 @@ gboolean accelerator_window_key_press(GtkWidget *widget, GdkEventKey *event, gpo
 
        if(!dialog.m_waiting_for_key)
                return false;
+
+#if 0
        if(event->is_modifier)
                return false;
+#else
+       switch(event->keyval)
+       {
+               case GDK_Shift_L:
+               case GDK_Shift_R:
+               case GDK_Control_L:
+               case GDK_Control_R:
+               case GDK_Caps_Lock:
+               case GDK_Shift_Lock:
+               case GDK_Meta_L:
+               case GDK_Meta_R:
+               case GDK_Alt_L:
+               case GDK_Alt_R:
+               case GDK_Super_L:
+               case GDK_Super_R:
+               case GDK_Hyper_L:
+               case GDK_Hyper_R:
+                       return false;
+       }
+#endif
+
        dialog.m_waiting_for_key = false;
 
        // 7. find the name of the accelerator
@@ -560,7 +583,6 @@ public:
         accelerator.modifiers = (GdkModifierType)0;
         return;
       }
-      int modifiers = 0;
 
          gtk_accelerator_parse(value, &accelerator.key, &accelerator.modifiers);
          accelerator = accelerator; // fix modifiers