MOUSEX MOUSEY Offset

Here is my question…

I am drawing stuff with openGL in a script. The only problem I have is that MOUSEX and MOUSEY return the coordinates in regards to the whole blender window and not the current window. Where can I find the offset of the current script window from the entire blender window?

https://blenderartists.org/forum/viewtopic.php?p=106127&highlight=screen+coordinates#106127

Martin

I searched and obviously did not look hard enough. You are awsome! Thanks!

hey guys,

Tried the code posted by Theeth here. It works within the text-editor. How about if we wanted to achieve the same sort of event capturing for the 3d MEsh as well?

Say, when the mouse howers over a particular Text written on the Mesh.

How should that work?