intercept key press



hi people out there !
in my program i want to close a dialog when the user presses the "Esc" button
i tried to do that by connecting the signal "key-press-event" to the dialog
here is the test function i use

gboolean on_dialog_key_press_event (GtkWidget dial, GdkEventKey *key, gpointer usrdata)
{
        if (key->keyval == GDK_Escape) printf ("escape\n");
        return false;
}

the thing is that the test fails because the content of "key" does not seem to be set
it is the same for the event "key-release-event"
can someone tell me more about this lack ?

_________________________________________________________________
Dialoguez en direct et gratuitement avec vos amis sur http://g.msn.fr/FR1001/866 MSN Messenger !




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]