TypeKeys

This API enables you to enter characters into a component. Although the API is generally used for custom controls, it may also be used to create a customized action on a standard Java control.

JavaControl.TypeKeys(string keys);

The TypeKeys API for Java controls is similar to the TypeKeys API for standard controls. The keys string can be a combination of alphanumeric characters, and the following special keys and modifiers:

Note: The TypeKeys API is not supported for JavaTablesCells and JavaTreeNodes.

Keyboard Character

String Key

Keyboard Character

String Key

Alt

%

F1

{F1}

Backspace

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

F2

{F2}

Break

{BREAK}

F3

{F3}

Caps lock

{CAPSLOCK}

F4

{F4}

Ctrl

^

F5

{F5}

Delete or Del

{DELETE} or {DEL}

F6

{F6}

Down arrow

{DOWN}

F7

{F7}

End

{END}

F8

{F8}

Enter

{ENTER}or ~

F9

{F9}

Esc

{ESC}

F10

{F10}

Help

{HELP}

F11

{F11}

Home

{HOME}

F12

{F12}

Ins or Insert

{INS}or {INSERT}

F13

{F13}

Left arrow

{LEFT}

F14

{F14}

Num lock

{NUMLOCK}

F15

{F15}

Page down

{PGDN}

F16

{F16}

Page up

{PGUP}

Keypad add

{ADD}

Print screen

{PRTSC}

Note: Reserved for future use.

Keypad subtract

{SUBTRACT}

Right arrow

{RIGHT}

Keypad multiply

{MULTIPLY}

Scroll lock

{SCROLLLOCK}

Keypad divide

{DIVIDE}

Shift

+

 

 

Tab

{TAB}

 

 

Up arrow

{UP}

 

 

In the following example, the letters abc are entered into a field, and the Tab key advances the cursor to the next input field, where the letters xyz are entered.

TypeKeys("abc{Tab}xyz");

In the next example, the following sequence of keys is entered: Ctrl + Home and Alt + Page Up.

TypeKeys("^{Home}%{PGUP}");

A subset of the keys combinations in Java are supported:

Key modifiers can precede only one special key (i.e., Alt or Shift or Ctrl).

Unlike the Standard APIs, there is no support for repeating keys. For example, the string key for entering X twice is:

oJava API: TypeKeys("XX")

oStandard API: TypeKeys(“{X 2}”)