VS:KeyDown

From Vectorworks Developer
Jump to: navigation, search

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

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.

FUNCTION KeyDown(
VAR asciiCode  :LONGINT) : BOOLEAN;
def vs.KeyDown():
    return (BOOLEAN, asciiCode)

Parameters

asciiCode LONGINT ASCII code of key pressed.

Remarks

Using KeyDown (cCode) in a REPEAT...UNTIL loop such as the one that follows

will cause VectorWorks to hang. (Windows only).

REPEAT
i := i + 1;
message ('i = ',i);
wait (1);
UNTIL KeyDown (keyCode);

If you have any scripts that use this, you had better check them.

*******************************
*         Tom Urie            *
* Integrated Products Group   *
*        Vectorworks          *
*  vstanev@vectorworks.net    *
*******************************


I think that this is fixed in 901.


Also from Tom... A word of warning:

The VectorScript function KeyDown () is initialized as TRUE on Windows in 9.5. Better check any scripts that use it.

Tom

Example

VectorScript

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}

Python


Version

Availability: from All Versions
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox