GetAsyncKeyState

Determines whether a key is up or down at the time the function is called, and whether the key was pressed after a previous call to GetAsyncKeyState.

For more information, see MSDN for information on the GetAsyncKeyState Windows API function.

Syntax

Rhino.GetAsyncKeyState (intKey)

Parameters

intKey

Required.  Number.  The virtual-key code.  For more information, see Virtual Key Codes.

Returns

Boolean

If the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState.

Null

On error.

Example

Const VK_SHIFT = &h10

Dim nShift

nShift = Rhino.GetAsyncKeyState(VK_SHIFT)

If nShift And &h8000 Then

  Rhino.Print "Shift key is down"

Else

  Rhino.Print "Shift key is not down"

End If

Also See

GetSystemMetrics