The SendKeys method sends a null-terminated string of keys to the presentation space for the connection associated with the ECLPS object. There are three signatures for the SendKeys method. If no position is specified, the keystrokes are entered starting at the current host cursor position. A position may be specified (in linear or row and column coordinates), in which case the host cursor is first moved to the given position.

The text string may contain plain text characters, which are written to the presentation space exactly as given. In addition, the string can contain imbedded keywords (mnemonics) that represent various control keystrokes such as 3270 Enter keys and 5250 PageUp keys. Keywords are enclosed in square brackets (for example, [enter]). When such a keyword is encountered in the string it is translated into the proper emulator command and sent. A text string may contain any number of plain characters and imbedded keywords. The keywords are processed from left to right until the end of the string is reached. For example, the following string would cause the characters ABC to be typed at the current cursor position, followed by a 3270 Erase-end-of-field keystroke, followed by a 3270 Tab keystroke, followed by XYZ and a PF1 key:
Note: Blank characters in the string are written to the host presentation space like any other plain text character. Therefore, blanks should not be used to separate keywords or text.
To send a left or right square bracket character to the host, it must be doubled in the text string (for example, it must occur twice to cause a single bracket to be written). The following example causes the string “A [:]” to be written to the presentation space.

If you attempt to write keystrokes to a protected position on the screen, the keyboard locks and the remainder of the keystrokes are discarded.

Refer to Sendkeys Mnemonic Keywords for a list of keywords.