The modifier state does in fact incorporate modal keys such as
NumLock. So code assuming that state be 0 if no modifier is
pressed is wrong, if NumLock, CapsLock and the like are active.
The solution is to filter out these modal keys with
gtk_accelerator_get_default_mod_mask(), and compare the result.
This fixes the problem of being unable to type keys used as
single-letter shortcuts.
{
GtkWindow* window = GTK_WINDOW (widget);
GtkWidgetClass* widget_class;
+ guint clean_state;
if (event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK))
if (sokoke_window_activate_key (window, event))
return TRUE;
- if (!event->state && gtk_window_propagate_key_event (window, event))
+ clean_state = event->state & gtk_accelerator_get_default_mod_mask();
+ if (!clean_state && gtk_window_propagate_key_event (window, event))
return TRUE;
if (!(event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))