Last active
May 15, 2017 14:46
-
-
Save yeled/a5ddefbfd3f4123bb81f4cccf1a4cc8d to your computer and use it in GitHub Desktop.
find what gdk code is pressed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <gtk/gtk.h> | |
static gboolean | |
key_event(GtkWidget *widget, | |
GdkEventKey *event) | |
{ | |
g_printerr("%s\n", | |
gdk_keyval_name (event->keyval)); | |
return FALSE; | |
} | |
int main( int argc, | |
char *argv[] ) | |
{ | |
GtkWidget *window; | |
gtk_init (&argc, &argv); | |
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); | |
g_signal_connect(window, "key-release-event", G_CALLBACK(key_event), NULL); | |
gtk_widget_show (window); | |
gtk_main (); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the code is from http://stackoverflow.com/questions/10134956/in-simple-gtk-key-press-event-example-gdk-shift-mask-seems-to-be-ignored