From 8e10595ce3c812561b9ecacc3ebe20d1ce6d41ab Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 25 Mar 2009 11:49:50 +0000 Subject: [PATCH] make it work with older Gtk again git-svn-id: svn://svn.icculus.org/netradiant/trunk@229 61c419a2-8eb2-4b30-bcec-8cead039b335 --- libs/gtkutil/accelerator.h | 2 +- radiant/commands.cpp | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/libs/gtkutil/accelerator.h b/libs/gtkutil/accelerator.h index 1e682b57..4e441b21 100644 --- a/libs/gtkutil/accelerator.h +++ b/libs/gtkutil/accelerator.h @@ -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 { diff --git a/radiant/commands.cpp b/radiant/commands.cpp index a676a631..31720686 100644 --- a/radiant/commands.cpp +++ b/radiant/commands.cpp @@ -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 -- 2.39.2