mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-02 17:00:19 +00:00
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:
parent
d724506abe
commit
5a34d0f816
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user