GNOME Bugzilla – Bug 602773
GdkEventKey.is_modifier is 0 for Shift, Ctrl, Alt keys
Last modified: 2016-09-17 20:25:02 UTC
On Windows, when a key-press-event is received after the user presses Shift, Ctrl or Alt, the GdkEventKey.is_modifier flag is 0. It should be 1. To see the problem, build the following program and press a key such as Shift. I'm using GTK 2.18.3 on Windows 7. == test.c == // build with: gcc -Wall test.c `pkg-config --cflags --libs gtk+-2.0` -o test #include <stdio.h> #include <gtk/gtk.h> static gboolean key_press_event(GtkWidget *widget, GdkEventKey *event) { printf("is_modifier = %u\n", event->is_modifier); return TRUE; } int main(int argc, char *argv[]) { gtk_init(&argc, &argv); GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show_all(window); g_signal_connect(G_OBJECT(window), "key-press-event", G_CALLBACK(key_press_event), NULL); gtk_main(); return 0; } == end ==
Created attachment 335764 [details] [review] GDK W32: Set is_modifier field in GdkKeyEvent This hardcodes Control, Alt and Shift as modifier keys.
Review of attachment 335764 [details] [review]: Looks good.
Attachment 335764 [details] pushed as 0274b2c - GDK W32: Set is_modifier field in GdkKeyEvent