Cursor position

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
Surendranath
Junior Member
Posts: 16
Joined: Mon Jan 07, 2013 9:43 am

Cursor position

Post by Surendranath » Fri Jan 18, 2013 2:03 am

How do I get the cursor position programmatically?

How do I move the cursor to a specific position on the screen in the program.

I do not have a handle on the event.

Thanks

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Cursor position

Post by andrew » Fri Jan 18, 2013 10:52 am

Surendranath wrote:How do I get the cursor position programmatically?
You should never have to do this. Please use the event handler pickCoordinate instead to receive an event whenever the mouse cursor position changes or the user enters a coordinate.

Perhaps I can be of more help if you let me know why you would like to query the mouse cursor position directly.
Surendranath wrote:How do I move the cursor to a specific position on the screen in the program.
The mouse cursor that is displayed by the operating system cannot be moved other than by moving the mouse.
The position of the cross hairs displayed by QCAD (yellow horizontal / vertical lines) can be set by:
di.setCursorPosition(pos);

Where di is an RDocumentInterface object and pos is an RVector.

Surendranath
Junior Member
Posts: 16
Joined: Mon Jan 07, 2013 9:43 am

Re: Cursor position

Post by Surendranath » Fri Jan 18, 2013 2:26 pm

Say I have drawn a line AB .The cursor is at B. I have to add another line programmatically at the end B of the line. This can be automated if I knew the cursor position without the user again having to click at B. I have to now click at B which fires the coordinateEvent and I am using the event.getModelPosition();

Thnaks

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”