Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This function sends a host key to the server in a Genie or a Rich Display session. For Rich Displays, the appropriate AID key is sent to the back-end program; however, no response indicator is set by this function.

Parameters:

  • key - description of key (not case sensitive); ; For Genie, valid values are "Enter", "F1" to "F24", "PageUp", "PageDown", "Disconnect" or "Quit", "Attn", "SysReq", "ErrorHelp", "Help", "Print", "RollLeft", "RollRight", and "Clear". For Rich Displays, valid values are "Enter", F1" to "F24", "Pause/Break", "Clear", "Alt-F1", "Help", "PageUp", "PageDown", "Print", "RecordBackspace", and "AutoEnter"
  • on timeout flag or additional keys - this second parameter is optional; if the second parameter is passed as True, the key is sent after a small timeout allowing other JavaScript code to finish running first; alternatively, for Genie, multiple parameters can be used to send additional keys on subsequent screens effectively causing a multi-step action

...

Code Block
javascript
javascript

pressKey("Enter");  // send the enter key

...

Code Block
javascript
javascript

setCursor(24, 1); pressKey("F1");  // set cursor to line 24 and send F1

...

Code Block
javascript
javascript

pressKey("Enter", true);  // send the enter key on a timeout

...

Code Block
javascript
javascript

pressKey("Enter", "F3");  // In Genie, send the enter key, then the F3 key

...