Re: GTK3 -- query mouse pointer coordinates for keyboard input?



On Fri, 2014-01-17 at 17:11 -0500, Jasper St. Pierre wrote:
Yeah. This is to maintain ABI compatibility. Technically, events have
private internal data, and you can use gdk_event_get_device(); to get
the
keyboard device for a key event.

This isn't documented very well; we should perhaps clean this up.

Indeed Ruby GTK3 bindings do not offer undocumented
gdk_event_get_device() for key events, and using deprecated
window.get_pointer() raises an exception.

So my current solution is: I already have motion notify events for my
drawing area, so for each such event I make a copy of event.x and
event.y data and use that value for next key event. Seems to work, at
least my program works again as with GTK2. Maybe I should additional
store the x, y values for each enter_notify event, otherwise coordinates
may be invalid at the border of the drawing area when mouse pointer is
coming from outside.

I will indeed consider filing a bug report.




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