The keyboard component resides in the system module. It keeps track of which component is the "focus"--the component which should receive text that the user enters.
Because this component resides in the system module, you will use the system:keyboard syntax to access it, as in the following example:
system:keyboard.focus = PasswordEntry
An application that wishes to handle _focusChanged() events can create its own Keyboard component.
Standard Properties
class, parent, proto, version.
focus component
The system focus. This is the component to which keyboard input is passed. Since many specific User Interfaces allow components to be navigated to and activated from the keyboard, these may have the focus just as well as text and entry components.
Setting focus to a component within a non-modal window while a modal window is visible will silently fail.
Bringing a form, dialog or floater to the front can set the system focus to one of the window's children (or possibly itself if none of its children will accept the focus).
Some components can not accept the focus, attempting to set focus to one of these components will not change focus.
focusInterest integer (0-1)
This property is useful for Keyboard components created by applications: if it is 1, then the component will raise _focusChanged() events when the focus changes; if it is 0, then the component won't raise events.
CreateCharEvent(action AS integer, char AS integer, modifierState AS integer)
Simulate a keyboard event, as if the user had entered text via the keyboard.
action integer (0, 1,2, 5)
0: Press and Release. This action generates both a key press and release for the indicated character.
1: Press. Signify the character generated as the press of a key.
2: Repeat. Signify the character generated as being a repeated character event, as if a physical key was being held down.
5: Release. Signify the character generated as being the release of a key.
char integer
Unicode value of the character entered. Special keys have special values:
KEY_BS (Backspace), KEY_DEL (Delete), KEY_ENTER, KEY_KP_RETURN (Numeric Keypad Enter), KEY_HOME, KEY_TAB, KEY_END, KEY_ESC, KEY_UP_ARROW, KEY_LEFT_ARROW, KEY_RIGHT_ARROW, KEY_DOWN_ARROW.
modifierState integer
The state of the Alt, Ctrl, and Shift keys and the state of the Caps Lock, Num Lock, and Scroll Lock modifiers. To specify which keys/modifiers are active, add together all numbers that apply from the following list:
LEFT_ALT - &H0080
RIGHT_ALT - &H0040
LEFT_CTRL - &H0020
RIGHT_CTRL - &H0010
LEFT_SHIFT - &H0008
RIGHT_SHIFT - &H0004
CAPS_LOCK - &H0400
NUM_LOCK - &H0200
SCROLL_LOCK - &H0100
newText string
Text representing the character events. For example, the string "pi/2" would result in the same behavior as if the user had typed p, i, /, 2.
The plus sign, caret, percent, curly brace, and parenthesis characters are used to represent modifier keys and special keys. To include these characters in your string, enclose them in curly braces: {+} {^} {%} {(} {)} {{} {}}.
To specify a key with one or more modifier keys, precede the regular key string with one or more of the characters:
For example, to simulate a Ctrl-Shift-Q, use the string "+^q." To simulate the modifier keys being held down while other keys are pressed, enclose the string for the other keys in parentheses. For instance, to simulate holding down the Shift key while pressing the I, B, and M keys, use the string "+(ibm)." Inside parentheses, all of these special characters `+', `^', `%', `(` lose their special meaning--the only special characters recognized are `{`, `}', and `)'. This means that you can not do nested parentheses or change the modifier keys while inside parentheses. So "+(Hi ^there)" will be treated as "+(Hi {^}there)," and "+(Hi (there))" will be treated as "+(Hi {(}there){)}."
The following strings represent special keys:
{BACKSPACE}, {BS}, {BKSP} Backspace
{F1}, {F2}, {F3}, {F4}, {F5}, {F6}, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12
{F7}, {F8}, {F9}, {F10}, {F11}, {F12}