Re: capturing keys press/realease
- From: Paul Davis <pbd op net>
- To: Giovanni Masullo <giovanni masullo icn siemens it>
- Cc: gtk-list gnome org
- Subject: Re: capturing keys press/realease
- Date: Thu, 18 Apr 2002 13:23:57 -0400
>i try to register a callback function this way:
> gtk_signal_connect( GTK_OBJECT (window),
> "key_press_event",
> cb_keypress,
> NULL);
> gtk_signal_connect( GTK_OBJECT (window),
> "key_release_event",
> cb_keypress,
> NULL);
>
>where cb_keypress is the following:
>
>void cb_keypress( GtkWidget *widget,
> GdkEvent *event,
> gpointer callback_data ) {
it should return int, either TRUE or FALSE. in your case, FALSE sounds
appropriate. Read the tutorial for more.
> switch(event->type) {
> case GDK_KEY_PRESS:
> printf("KEY PRESSED\n");
> break;
> case GDK_KEY_RELEASE:
> printf("KEY RELEASED\n");
> break;
> }
>};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]