PhantomScript v1.7 Reference - Copyright © 2006 P1 Systems Incorporated. All Rights Reserved.

Prev | Next | Users Guide | PhantomScript Reference | P1 Systems


Idle Time

WaitForKeystroke

Syntax

WaitForKeystroke keystroke-list [Timeout=<secs>] [Ignore] [Result=<var>]

Description

Wait for one or more specified keys to be pressed.

Parameters

keystroke-list

A list of key names. See Designating Keystrokes for a list of key names. This parameter may be a comma separated value (CSV) list enclosed in quotation marks or a list variable. (See List Variables.) An empty list or a list containing the string "Any" will match any keystroke.

Timeout=<secs>

Optional. The time period after which execution is to continue even if none of the specified keys is pressed. The default is to wait forever. The TimedOut intrinsic variable is set to True if a timeout occurs.

Ignore

Optional. If this parameter is present, the matching keystroke is not passed on to the application currently receiving keystrokes.

Result=<var>

Optional. A variable into which the keystroke that ends the wait is placed. This variable is cleared if a timeout occurs.

Remarks

Key names are case-sensitive. Thus, to detect both upper-case and lower-case versions of a character, include both in the keystroke-list.

Example

WaitForKeystroke "A,B,C,c" Ignore Timeout=10

The above statement will wait 10 seconds for an upper-case A or B or an upper- or lower-case C key to be pressed.



Prev | Next | Users Guide | PhantomScript Reference | P1 Systems

PhantomScript v1.7 Reference - Copyright © 2006 P1 Systems Incorporated. All Rights Reserved.