bindings: Convert to use GdkEvent API

This commit is contained in:
Matthias Clasen 2017-08-25 22:51:18 -04:00 committed by Carlos Garnacho
parent 5488009150
commit 01b993d1fb

View File

@ -1580,6 +1580,9 @@ gtk_bindings_activate_event (GObject *object,
GdkDisplay *display;
GtkKeyHash *key_hash;
gboolean handled = FALSE;
guint16 keycode;
GdkModifierType state;
guint group;
if (!GTK_IS_WIDGET (object))
return FALSE;
@ -1587,11 +1590,15 @@ gtk_bindings_activate_event (GObject *object,
display = gtk_widget_get_display (GTK_WIDGET (object));
key_hash = binding_key_hash_for_keymap (gdk_keymap_get_for_display (display));
gdk_event_get_keycode ((GdkEvent *)event, &keycode);
gdk_event_get_state ((GdkEvent *)event, &state);
gdk_event_get_key_group ((GdkEvent *)event, &group);
entries = _gtk_key_hash_lookup (key_hash,
event->hardware_keycode,
event->state,
keycode,
state,
BINDING_MOD_MASK () & ~GDK_RELEASE_MASK,
event->group);
group);
handled = gtk_bindings_activate_list (object, entries,
gdk_event_get_event_type ((GdkEvent *) event) == GDK_KEY_RELEASE);