KeyDown

<< Click to Display Table of Contents >>

 

KeyDown

KeyDown(KeyCode, Shift)

Occurs when a key is pressed, regardless of Screen's focus. The parameters on this event are described on the next table.

Available parameters on the KeyDown event

Name

Description

KeyCode

An integer number identifying the ASCII character of the pressed key

Shift

Shows the shortcut key used together with the pressed key:

4: SHIFT key

8: CTRL key

12: CTRL + SHIFT keys

 

Example:

Sub InitialScreen_KeyDown(KeyCode, Shift)
  'Displays a message box when
  'a user presses a key
  MsgBox "Key code: " & KeyCode
End Sub

 

NOTE

For a list with all available key codes for the KeyCode parameter, please check the article Keys Enumeration in Microsoft Developer Network.

Was this page useful?