key_release_event



Hi!

  I have this problem: I have one main window and one drawing area
inside. I want to catch the key_press_event and the key_release_event and
according to holding or not holding a key I want to change the current
cursor inside the drawing area.

  I wrote both signal handlers for main window and for the drawing area. I
added debugging messages and I see, that only key_press_event handler of
the main window is called.

  I also noticed in the maillist archive, that someone pointed out, that
the drawing area need to have the focus, so I tried something like

     GTK_WIDGET_SET_FLAGS(mydarea,GTK_CAN_FOCUS);
     gtk_widget_grab_focus(mydarea);

   ... and it didn't help.

  I wouldn't mind, if I could have chance to catch the signals only in the
main window handlers. It would be ok, but WHY the key_press_event
handler of the main window IS called and the key_release_event handler is
NEVER called?

  Can anyone help me?


							Jim







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