Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Command Index > P > PLUGIN

SendKeys

Scroll Prev Top Next More

The SendKeys plugin sends one or more keystrokes to the active control, as if typed at the keyboard.

 

Syntax:

 

PLUGIN SendKeys vResult|<Options>

 

Options:

 

Option

Value

Description

KEYS

value

Specifies the keys to be simulated, or code for special keys that aren't displayed when you press a key

WINDOW_NAME

value

Specifies the text that appears in the target window's title bar. The value can be left empty.

WAIT

ON

OFF (Default)

Specifies the wait for the keys to be processed by the recipient before returning control

 

Where:

 

vResult is the variable name to return "OK" or an error message

 

Notes:

 

Each option must be separated by the pipe "|" character.

 

It is advised to be very careful with the SendKeys plugin capability. If the sequence of commands gets interrupted by another process, and the focus is changed, unpredictable results may occur.

 

Special keys are enclosed in braces. As braces are used to enclose comments in R:BASE, quote the text so it is not interpreted as a comment.

 

Special Keys

 

Key

Code

BACKSPACE

{BACKSPACE}, {BS}, or {BKSP}

BREAK

{BREAK}

CAPS LOCK

{CAPSLOCK}

DEL or DELETE

{DELETE} or {DEL}

DOWN ARROW

{DOWN}

END

{END}

ENTER

{ENTER}or ~

ESC

{ESC}

HELP

{HELP}

HOME

{HOME}

INS or INSERT

{INSERT} or {INS}

LEFT ARROW

{LEFT}

NUM LOCK

{NUMLOCK}

PAGE DOWN

{PGDN}

PAGE UP

{PGUP}

PRINT SCREEN

{PRTSC}

RIGHT ARROW

{RIGHT}

SCROLL LOCK

{SCROLLLOCK}

TAB

{TAB}

UP ARROW

{UP}

F1

{F1}

F2

{F2}

F3

{F3}

F4

{F4}

F5

{F5}

F6

{F6}

F7

{F7}

F8

{F8}

F9

{F9}

F10

{F10}

F11

{F11}

F12

{F12}

F13

{F13}

F14

{F14}

F15

{F15}

F16

{F16}

 

To specify keys combined with any combination of the SHIFT, CTRL, and ALT keys, precede the key code with one or more of the following codes:

 

Key

Code

SHIFT

+

CTRL

^

ALT

%

 

Examples:

 

Example 01.

 

SET VAR vResult TEXT = NULL

 

--Set focus to an R:BASE Variable Memo control, then wait for 1 second before sending keys. Note the Variable Memo is set in the properties to accept the [Enter] key.

PROPERTY VariableMemo1 SET_FOCUS ' '

PAUSE FOR 1

 

PLUGIN SENDKEYS vResult|KEYS This text is displayed using the SendKeys plugin.~~

PLUGIN SENDKEYS vResult|KEYS 'This is one of the many "key" features in R:BASE!'~

 

--The Ctrl+Home moves to the beginning of the content.

PLUGIN SENDKEYS vResult|KEYS '^{HOME}'

--Adds text and then Enter

PLUGIN SENDKEYS vResult|KEYS Greetings from R:BASE!~~

 

--Ctrl+End moves to the end of the content then presses Enter

PLUGIN SENDKEYS vResult|KEYS '^{END}~~'

PLUGIN SENDKEYS vResult|KEYS Thank you for choosing R:BASE!

 

--Highlights the last line. this is Home, Shift+End

PLUGIN SENDKEYS vResult|KEYS '{HOME}+{END}'

 

Example 02.

SET VAR vResult TEXT = NULL

 

--Launch notepad and wait for 1 second to make sure notepad is loaded

LAUNCH NOTEPAD.EXE

PAUSE FOR 1

 

--While WINDOW_NAME is only required once to activate the window, it is safe to always specify it.

PLUGIN SENDKEYS vResult|WINDOW_NAME Untitled - Notepad|KEYS This text is displayed using the SendKeys plugin.~~

PLUGIN SENDKEYS vResult|WINDOW_NAME Untitled - Notepad|KEYS 'This is one of the many "key" features in R:BASE!'~