Code from haluk cetiner
on highend.
#include <maya/MSimple.h>
#include <maya/MGlobal.h>
#include <iostream>
#include <fstream>
using namespace std;
DeclareSimpleCommand(getcurPos, "ManualDesk", "8.0");
MStatus getcurPos::doIt( const MArgList& )
{
MStatus stat;WINSTA_READATTRIBUTES;
LPPOINT lpoint=new tagPOINT;
::GetCursorPos(lpoint);
clearResult();
appendToResult(lpoint->x);
appendToResult(lpoint->y);
return MS::kSuccess;
}
Em sábado, 3 de março de 2012 19h43min56s UTC-3, wilsimar escreveu:
>
> my window is maya native widget ("window -title ..."), no qt. I want a way
> to detect if esc key was pressed to quit my window, and before showwindow
> command, send my window to mouse position.
>
> I found this c++ api code for mouse screen position detection on highend
> site, but trying convert it to python, DeclareSimpleCommand raising python
> error (# Error: NameError: name 'DeclareSimpleCommand' is not defined # ).
>
> thanks Justin
>
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe