DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

Command: IsKeyPressed

Display all  Hide all

Command: IsKeyPressed

Specifies whether the specified key was pressed.

ReturnValue = IsKeyPressed(KeyValue)

Input Parameters

KeyValue Specifies the pressed key.

Return Parameters

ReturnValue The return value is a Boolean variable type.

Use the IsKeyPressed command to request the keys of the keyboard and of the mouse. The command returns the physical key not the logical key. For example, even if a left-handed user re-configured the mouse buttons, the command returns the left mouse button when this button is pressed.

Example

The following example outputs a message after the space bar was pressed. The KeyWait stops the script until a key is pressed.

VBScriptPython

 

Call MsgBoxDisp("Press space bar.",,,,5,True)
Do While Not IsKeyPressed(&H20) 
  Call KeyWait
Loop
Call MsgBoxDisp("Space bar pressed")

 

Was this information helpful?