GTK: filter events more precisely.

Turns out that GDK_MOD2_MASK, at least on some systems, corresponds
to NumLock. Use the function provided by GDK to handle this.

Fixes #634.
pull/640/head
whitequark 2020-06-21 01:20:57 +00:00
parent a80a0337a5
commit d238f985fb
1 changed files with 2 additions and 1 deletions

View File

@ -565,7 +565,8 @@ protected:
KeyboardEvent event = {}; KeyboardEvent event = {};
event.type = type; event.type = type;
if(gdk_event->state & ~(GDK_SHIFT_MASK|GDK_CONTROL_MASK)) { Gdk::ModifierType mod_mask = get_modifier_mask(Gdk::MODIFIER_INTENT_DEFAULT_MOD_MASK);
if((gdk_event->state & mod_mask) & ~(GDK_SHIFT_MASK|GDK_CONTROL_MASK)) {
return false; return false;
} }