PDA

View Full Version : window at mouse pointer


mossin
01-31-2011, 10:46 AM
hi all,

is it possible to create a window at mouse pointer?

NaughtyNathan
01-31-2011, 01:31 PM
you can use the draggerContext command to get the mouse position, which you could then feed to the window -tlc flag to build a window at a specific point. However this only works on a viewport, so you wouldn't be able to do this wherever you liked (i.e. over another UI).

You can get more complex mouse info/functionality from the API via python though, but I can't tell you much about doing it that way...

:nathaN

mossin
02-01-2011, 04:01 AM
thanks NaughtyNathan

but that does'nt work.

correct me if i m wrong

i think there are two different spaces 1. screen space and 2. UI space

both r having different coordinates. context is working on screen & window is on UI

that is the reason i m not getting window at mouse position

Azrail
02-10-2011, 04:03 PM
If you're relying on mel I cant help, but if you have no problem doing it with python - you just need to install 'xlib (http://sourceforge.net/projects/python-xlib/)' package and than just use this:
source:
http://snipplr.com/view/19188/mouseposition-on-linux-via-xlib/

from Xlib import X, display
d = display.Display().screen().root.query_pointer()._data


print "x="
print d["root_x"]
print "y="
print d["root_y"]


oops, forgot to mention it's for linux only

CGTalk Moderation
02-10-2011, 04:03 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.