VS:MouseDown: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Function MouseDown returns TRUE if a mouse down event has occurred within the active document window.
Return TRUE if a mouse down event has occurred within the active document window.
 
Remark for VW2014 python: return value for the point is always an empty tuple (0, 0)
</desc>
</desc>


Line 28: Line 26:
p
p
REAL
REAL
Returns coordinates of mouse click.
Coordinates of mouse click.
Remark for VW2014 python: Always an empty tuple (0, 0) - use GetMouse() if down == True
</line>
</line>
</lineList>
</lineList>

Revision as of 08:36, 9 July 2019

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Return TRUE if a mouse down event has occurred within the active document window.

FUNCTION MouseDown(
VAR pX,pY :REAL) : BOOLEAN;
def vs.MouseDown():
    return (bool, (px, py))

Parameters

p REAL Coordinates of mouse click.

Example

VectorScript

REPEAT
UNTIL MouseDown(x1,y1);
REPEAT
UNTIL MouseDown(x2,y2);
MoveTo(x1,y1);
LineTo(x2,y2);

Python

down = False
while not down:
    down, pt = vs.MouseDown()  # pt is a tuple (x, y)

vs.AlrtDialog(str(pt))

Version

Availability: from All Versions