Search
FlowChart.KeyDown Event
See Also
 



Raised when the user presses a key.

 Syntax

VB6  Copy Code

Public Event KeyDown

 Event Data

Parameter

Type

Description

keyCode

[input] long

The virtual key code.

shift

[input] long

The state of the modifier keys - SHIFT, CTRL, ALT.

Dispatch ID: 22

 Remarks

Raised when the user presses a key. The event corresponds to the WM_KEYDOWN Windows message, and is actually triggered by it. The second parameter is a bit-mask exposing the state of SHIFT, CTRL and ALT keys, through the first, second and third bit respectively. You might check the state like this:

VB  Copy Code

' Use bit masks to determine which key was pressed.
shiftDown = (Shift And 1) > 0
ctrlDown = (Shift And 2) > 0
altDown = (Shift And 4) > 0

' Display message telling user which key was pressed.
If shiftDown Then MsgBox "You pressed the SHIFT key."

 See Also