| AutoKey | User Interactive |
Declaration:
FUNCTION AutoKey
( VAR asciiCode:LONGINT ) :BOOLEAN ; Description:
Function AutoKey returns TRUE if a non-modifier keyboard character has been continually depressed for longer than the system defined key repeat rate. If a keyboard character has been continually depressed, then ASCII code of the character is returned in parameter asciiCode.
Modifier keys are defined as the Caps Lock, Command, Control, Option, and Shift keys.
Parameters:
asciiCode The ASCII code of the key depressed. Example:
WHILE NOT AutoKey(keyHit) DO BEGIN SysBeep; SysBeep; END; Message('The key pressed was ',keyHit);
| CapsLock | User Interactive |
Declaration:
FUNCTION CapsLock
:BOOLEAN ; Description:
CapsLock returns TRUE if the Caps Lock was depressed during the last user event. This function operates with the MouseDown, KeyDown, AutoKey, GetPt, GetPtL, GetLine, and GetRect calls.
| Command | User Interactive |
Declaration:
FUNCTION Command
:BOOLEAN ; Description:
Command returns TRUE if the Command key (Mac) or Control key (Windows) was depressed during the last user event. This function operates with the MouseDown, KeyDown, AutoKey, GetPt, GetPtL, GetLine, and GetRect calls.
| GetKeyDown | User Interactive |
Declaration:
PROCEDURE GetKeyDown
( VAR asciiCode:LONGINT ) ; Description:
Procedure GetKeyDown pauses execution of a VectorScript routine until a key is pressed by the user. When the key is pressed, the ASCII code of the key is returned.
Parameters:
asciiCode ASCII code of key pressed.
| GetLine | User Interactive |
Declaration:
PROCEDURE GetLine
( VAR p1X :REAL; VAR p1Y :REAL; VAR p2X :REAL; VAR p2Y :REAL ) ; Description:
Procedure GetLine returns two user selected points, and draws a temporary "rubberband" line when prompting for the second point. This cannot be used if there is a function anywhere in the calling chain.Parameters:
p1 Returns coordinates of first user click. p2 Returns coordinates of second user click.
| GetMouse | User Interactive |
Declaration:
PROCEDURE GetMouse
( VAR pX :REAL; VAR pY :REAL ) ; Description:
Procedure GetMouse tracks and returns the current location of the cursor within the active Vectorworks document, allowing the cursor coordinates to be returned dynamically while moving the cursor onscreen.
Parameters:
p Returns current mouse coordinates. Example:
BEGIN WHILE NOT KeyDown(aCode) DO BEGIN GetMouse(CursX,CursY); Message('X : ',CursX,' Y : ',CursY); END; END; {displays the cursor coordinates as it is moved around onscreen}
| GetPt | User Interactive |
Declaration:
PROCEDURE GetPt
( VAR pX :REAL; VAR pY :REAL ) ; Description:
Procedure GetPt switches the cursor to selection mode and allows the user to select a point in a Vectorworks document. This cannot be used if there is a function anywhere in the calling chain.
Parameters:
p Returns coordinates of mouse click. Example:
PROCEDURE Example; VAR pt :POINT; BEGIN GetPt(pt.x, pt.y); Message(pt); END; RUN(Example);
| GetPtL | User Interactive |
Declaration:
PROCEDURE GetPtL
( p1X :REAL; p1Y :REAL; VAR p2X :REAL; VAR p2Y :REAL ) ; Description:
Procedure GetPtL creates a temporary "rubberband" line from a specified point to the user selected end point. This cannot be used if there is a function anywhere in the calling chain.Parameters:
p1 Coordinates of line start point. p2 Returns coordinates of mouse click. Example:
PROCEDURE Example; VAR pt1, pt2 :VECTOR; BEGIN GetPt(pt1.x, pt1.y); GetPtL(pt1.x, pt1.y, pt2.x, pt2.y); MoveTo(pt1.x, pt1.y); LineTo(pt2.x, pt2.y); END; RUN(Example);
| GetRect | User Interactive |
Declaration:
PROCEDURE GetRect
( VAR p1X :REAL; VAR p1Y :REAL; VAR p2X :REAL; VAR p2Y :REAL ) ; Description:
Procedure GetRect draws a temporary "rubberband" rectangle onscreen, similar to a selection marquee. The user defines the rectangle by selecting two points which define the top left and bottom right of the rectangle. This cannot be used if there is a function anywhere in the calling chain.Parameters:
p1 Returns coordinates of first user click. p2 Returns coordinates of second user click.
| KeyDown | User Interactive |
Declaration:
FUNCTION KeyDown
( VAR asciiCode:LONGINT ) :BOOLEAN ; Description:
Function KeyDown returns TRUE if a non-modifier keyboard character has been depressed. When TRUE is returned, the ASCII code of the character is returned.
Modifier keys are the Caps Lock, Command, Control, Option, and Shift keys.
Parameters:
asciiCode ASCII code of key pressed. Example:
WHILE NOT KeyDown(keyHit) DO BEGIN SysBeep; SysBeep; END; Message('The key pressed was ',keyHit); {an annoying example of one use of the KeyDown function}
| MouseDown | User Interactive |
Declaration:
FUNCTION MouseDown
( VAR pX :REAL; VAR pY :REAL ) :BOOLEAN ; Description:
Function MouseDown returns TRUE if a mouse down event has occurred within the active document window.
Parameters:
p Returns coordinates of mouse click. Example:
REPEAT UNTIL MouseDown(x1,y1); REPEAT UNTIL MouseDown(x2,y2); MoveTo(x1,y1); LineTo(x2,y2);
| Option | User Interactive |
Declaration:
FUNCTION Option
:BOOLEAN ; Description:
Option return TRUE if the Option key (Mac) or Alt key (Windows) was depressed during the last user event. This function operates with the MouseDown, KeyDown, AutoKey, GetPt, GetPtL, GetLine, and GetRect calls.See Also:
MouseDown KeyDown AutoKey
| SetCursor | User Interactive |
Declaration:
PROCEDURE SetCursor
( cursor:INTEGER ) ; Description:
Procedure SetCursor changes the appearance of the screen cursor.
Table - Cursor Styles
Cursor Style Style Flag Large Cross LgCrossC Small Cross SmCrossC Watch WatchC Text Bar TextBarC Arrow ArrowC Hand HandC Parameters:
cursor Cursor style setting. Example:
SetCursor(LgCrossC);
| Shift | User Interactive |
Declaration:
FUNCTION Shift
:BOOLEAN ; Description:
Shift returns TRUE if the Shift key was depressed during the last user event. This function operates with the MouseDown, KeyDown, AutoKey, GetPt, GetPtL, GetLine, and GetRect calls.