Stuffs a character string into an edit control, simulating typed user input.

Syntax 

<oRef>.keyboard(<keystroke expC>)

<oRef>

The control to receive the keystrokes.

<keystroke expC>

A string, which may include key codes.

Property of

Browse, ComboBox, Editor, Entryfield, SpinBox

Description

Use keyboard( ) when you want to simulate typing keystrokes into a control. The control does not have to be the one that has focus.

Note

If you want to set a value in a control, it’s better to assign the value property directly.

Use curly braces enclosed by quotation marks ("{ }") in <keystroke expC> to indicate cursor keys or characters by ASCII code. The following key labels may be used inside the curly braces:

Alt+0 through Alt+9

Ctrl+LeftArrow

Enter

RightArrow

Alt+A through Alt+Z

Ctrl+PgDn

Esc

Shift+F1 through Shift+F9

Backspace

Ctrl+PgUp

F1 through F12

Shift+Tabw

Backtab

Ctrl+RightArrow

Home

Space or Spacebar

Ctrl+A through Ctrl+Z

Ctrl+Tab

Ins

Tab

Ctrl+End

Del

LeftArrow

UpArrow

Ctrl+F1 through Ctrl+F10

DnArrow

PgDn

 

Ctrl+Home

End

PgUp

 

You may specify a character by its ASCII code by enclosing the value in the curly braces. If the value inside the curly braces is not a recognized key label or ASCII value, the curly braces and whatever is between them are ignored.

Calling keyboard( ) immediately fires the control’s key event, if any. In contrast, the KEYBOARD command stuffs keystrokes in the main typeahead buffer. The control that has focus then picks up the keys from the typeahead buffer as usual.