sendKeyClick()

The function sends a key press and key release to the current input focus.

Synopsis

int sendKeyClick([shape s,] string text, string keyName = "", int modifiers = 0);

int sendKeyClick([shape s,] string text, int keyCode = 0, int modifiers = 0);

Parameters

Parameter Description
s

This parameter is used to find the window to which the key events shall be sent.

Without the shape argument, or with a (shape)0 argument, the events are sent to the window which currently is the active popup or has the keyboard focus.

text The string to be displayed/inserted into an input widget.
keyCode One of the predefined KEY_ constants, e.g. KEY_F1, KEY_LEFT, KEY_ENTER, KEY_SPACE
keyName Name of the key that should be sent. Can be either "Backspace", "Home", "End", "Tab", "Backtab", "Space", "Return", "Enter", "Page Up", "Page Down", "Escape".
modifiers A combination (binary OR) of the following constants: KEY_SHIFT, KEY_CONTROL, KEY_ALT, KEY_META

Return value

-

Errors

-

Description

The function sends a key press and release to the current input focus containing the pressed key as well as optional modifier keys.

For sending a special key (e.g. KEY_CONTROL + A) the text parameter must be empty.

Assignment

Miscellaneous functions

Availability

UI