make it work with older Gtk again

git-svn-id: svn://svn.icculus.org/netradiant/trunk@229 61c419a2-8eb2-4b30-bcec-8cead039b335
This commit is contained in:
divverent 2009-03-25 11:49:50 +00:00
parent 2a41079750
commit 8e10595ce3
2 changed files with 24 additions and 2 deletions

View 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
{

View 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