$keyboard
Return or set the current keyboard translation table.
$keyboard
$keyboard =
Table
Example: $keyboard = "MSWINX"
Parameters
Parameter | Data Type | Description |
---|---|---|
Table | String | Name of a keyboard translation table. |
Return Values
Name of the keyboard table currently in use. The values returned by default for each GUI are shown in the following table:
GUI | Default value of $keyboard |
---|---|
Character mode | USYSTERM
|
Microsoft Windows | MSWINX
|
Use
Use in Form components.
Description
The $keyboard function can return or set the current keyboard translation table.
The keyboardSwitch trigger of the application shell can be used to
assign a new value to the $keyboard function. This trigger is activated at any
time in the application it receives a ^SWITCH_KEY request. The default value (if
UKEYB
or $keyboard have not been set) is determined by the GUI
in use.
Switching Keyboard Layouts
The ProcScript in the example below switches
between a keyboard layout with numeric keys, and a keyboard layout without numeric keys on a VT200
terminal. When VTNUM is in use, the 9 key means 9
; when VT200 is in
use, the 9 key means CLEAR. The VT200 table is the USYS standard layout.
trigger keyboardSwitch if ($keyboard = "VTNUM") $keyboard = "VT200" else $keyboard = "VTNUM" endif end; keyboardSwitch
Switching Keyboard Layouts for a Field
The following example switches to a keyboard with numeric keys for one field only. When the user enters a particular numeric field with NEXT_FIELD, the keyboard layout is switched to the alternate layout. When they leave the field with NEXT_FIELD, the default keyboard layout is restored:
;Field (of field before numeric field) trigger next $keyboard = "VTNUM" ; switch to VTNUM keyboard end; ;Field (of numeric field) trigger: next $keyboard = "VT200" ; switch to VT200 keyboard end;