Some times one needs a mouse event relative to current mouse position - not the
one relative to current window or an absolute position. For example - when one
chooses a mouse-3 menu item. Here's the way to implement it using
mouse.absolute:
from Xlib import display
c = display.Display().screen().root.query_pointer()._data
x = c["root_x"]
y = c["root_y"]
'x' and 'y' are current mouse position. One can then use relative position (to
the current one - not to the top of the current window) using:
mouse.click_absolute(x + offset_x,y + offset_y, button)
Original issue reported on code.google.com by kheyfbo...@gmail.com on 12 Aug 2011 at 6:37
Original issue reported on code.google.com by
kheyfbo...@gmail.com
on 12 Aug 2011 at 6:37