THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/05/2007 at 10:44, xxxxxxxx wrote:
Oh, I completely understand you. You need the cursor position on the screen - in the active viewport.
WS = World to Screen coordinates. This takes a point in the 3D viewport and converts it to 2D screen coordinates - these are the cursor coordinates within the viewport.
There is no other way that I know of to get the mouse cursor coordinates using the SDK (unlike Tool plugins and GUI (dialog) elements). There is no GetMousePos() type method in any of the viewport classes.
GetInputEvent()/GetInputState() are only usable with GeDialog and GeUserArea (they're out). There are generalized versions of these two methods, but haven't tried them in the way that you require.
ToolData::GetCursorInfo() is, as you mentioned, only usable with Tool plugins.
As mentioned, a SceneHook plugin has exactly what you need: SceneHookData::GetCursorInfo() and SceneHookData::MouseInput(). Tie it to the Command plugin and 'fake' it. :)