gtkeventcontrollerkey: Add get_group() call

Callers can use this function on a key-pressed/released signal
to find out the key event group, useful in a few places.
This commit is contained in:
Carlos Garnacho 2018-03-22 17:54:52 +01:00
parent d724506abe
commit 5a34d0f816
2 changed files with 15 additions and 0 deletions

View File

@ -235,3 +235,16 @@ gtk_event_controller_key_forward (GtkEventControllerKey *controller,
return FALSE;
}
guint
gtk_event_controller_key_get_group (GtkEventControllerKey *controller)
{
guint group;
g_return_val_if_fail (GTK_IS_EVENT_CONTROLLER_KEY (controller), FALSE);
g_return_val_if_fail (controller->current_event != NULL, FALSE);
gdk_event_get_key_group (controller->current_event, &group);
return group;
}

View File

@ -55,6 +55,8 @@ GtkIMContext * gtk_event_controller_key_get_im_context (GtkEventControllerK
GDK_AVAILABLE_IN_ALL
gboolean gtk_event_controller_key_forward (GtkEventControllerKey *controller,
GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
guint gtk_event_controller_key_get_group (GtkEventControllerKey *controller);
G_END_DECLS