How to control both mouse and keyboard events in application



Dear All
 I am modifying GPE application to handle keyboard events. Especially the 
Tree. 
  
For eg. in gpe-gallery..

my main window listens to keyboard-event and connects to this callback...The 
GDK_Left, GDK_Right and other keys with integer argument or without any 
argument work but GDK_F1/F2/F3/F4 that has to pass the widget and data does 
not have any effect.

Please can you tell me how to go about this problem.....

 gint keyboard_event_handler(GtkWidget *widget, GdkEventKey *event, gpointer 
data)

{

switch (event->keyval) {

case GDK_Left:

previous_image(NULL);

break;

case GDK_Right:

next_image(NULL);

break;

case GDK_Page_Up:

image_zoom_in();

break;

case GDK_Page_Down:

image_zoom_out();

break;

case GDK_End:

gtk_main_quit();

break;

case GDK_F1:

gtk_signal_connect (GTK_OBJECT (image_event_box), "button-press-event", 
GTK_SIGNAL_FUNC (button_down), scrolled_window);

break;

case GDK_F2:

gtk_signal_connect (GTK_OBJECT (image_event_box), "button-release-event", 
GTK_SIGNAL_FUNC (button_up), NULL);

break;

case GDK_F3:

gtk_signal_connect (GTK_OBJECT (image_event_box), "motion-notify-event", 
GTK_SIGNAL_FUNC (motion_notify), scrolled_window);

break;

}

}

 Thank you

Diana



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