tracking mouse pointer



Hi.

In my application, i use a widget that can be clicked for certain actions.
As the pointer is moved over the widget, it provides a visual feedback,
which hints about particular action that will be performed at given position.

In general, it works just fine by intercepting "motion-notify-event".  There
are two minor, but annoying problems, though.

First of all, i would like it to provide feedback when the window containing
the widget is "popped" (i.e shown, deiconified, or maybe shown together with
its desktop etc.)  I tried to make "show", "map" or "enter-notify-event"
callbacks to call gtk_widget_get_pointer() and use its information, but
either that didn't work at all, or the coordinates were wrong.  Any ideas?

Another problem is that i use modifier keys (like Shift) to alter the action
performed.  This would in turn alter the feedback depending on currently
pressed keys.  However, i have to use events like "key-(press|release)-event"
instead of "motion-notify-event" (one can (de)press Shift without touching
his mouse) and those events report "lagged" modifiers.  I.e. event structure
for a "key-press-event" for Shift would still claim that Shift is depressed.
Is there some way to get proper modifiers, or do i have to do that by hands?

Paul Pogonyshev



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