5250 Keyboard Reference
tn5250.ttkeyboard file must be in UTF-8 format.
All lines in the
tn5250.ttkeyboard file must end in a line feed or a carriage return/line
feed pair. All settings are case-sensitive.
tn5250.ttkeyboard files are available for download:
These settings identify specific keyboard layouts and set off comments.
|+||Name keyboard layout and begin section. Also ends previous keyboard
layout if one is present. A period in the name identifies the layout as subordinate
to another layout with the same name, but without the dot extension. It also prevents the layout name from being
displayed in TinyTERM. For example,
|#||Comment line. These can be inserted anywhere in the tn5250.ttkeyboard file.
These settings can be placed anywhere in the tn5250.ttkeyboard file, preceded with a dash. They will affect all lines below them, until a new instance of the setting is found.
|fontSize||Maximum font size in points of main key labels. The label size will be
reduced automatically to fit the key if needed.
|keyboardHeight||Sets the height of the keyboard layout. The value is in pixels on first-
and second-generation iPads. On the new iPad with Retina display, this value is
half the number of pixels the layout will use. Defaults to 350
|keyboardWidth||Sets the width of the layout. Uses the same pixel values as
|keyHeight||Changes the default height of the keys, relative to a base value of 1.
Sets vertical position and horizontal justification of the main key label.
See image at right for the available values. Note that 0, 3 and 6 left-justify the
text; 2, 5 and 8 right-justify it; and 1, 4 and 7 center the label. Defaults to 4.
This option is only available on iPad.
|layout||Sets the position of the keyboard layout:
|lineJustification||Sets the justification for rows of keys:
|margin||Minimum number of pixels on each edge – top, bottom, left and
right – of the keyboard.
|orientation||Used only within layouts. Determines whether the
layout displays in portrait, landscape or both modes:
|shiftFontSize||Maximum font size in points of
|shiftLabelPosition||Starting position of the
|size||Changes the default width of keys, relative to a base value of 1.
|spacing||Minimum number of pixels between keys
When a key is defined within square brackets [ ], options may be added to the definition, set off by two semicolons. Many of the general settings can also be applied to individual keys, and so are repeated below with key-specific examples. Options are all case-sensitive.
When a semicolon is desired as a displayed character inside the brackets, such as
for a label or
shiftLabel, separate it from the double semicolons by a
space for the display character, and use the hexadecimal value \x003b as the keyChar
for the value sent:
|\||Escape character. Used for special characters
that have other uses without the \. Square brackets are not required for
|blank||When set to 1, prevents the key from being drawn. Used for creating
space between visible keys in addition to that specified by the
|capsKey||When set to 1, causes the key to act as a Caps Lock key,
regardless of other settings.
|hideKey||When set to 1, causes the key to hide the keyboard when tapped. Also
replaces any text with a keyboard graphic. The keyboard can be restored by
tapping the keyboard button in the title bar, or by double-tapping the
|fontSize||Sets the font size for the primary label of the key.
|keyChar||Assigns a specific value to a key. Available values are
|keyHeight||Changes the height of the individual key, relative to a base value of 1.
|keyString||Assigns a multi-character string to a key.
This allows you to create custom key mappings with multi-byte
sequences on a single keystroke.
|labelPosition||Sets vertical position and horizontal justification of the
primary key label. This option is only available on iPad.
|scanBarcode||When set to 1, causes the key to trigger a camera scan when tapped.
|shiftFontSize||Sets the font size for the
|shiftId||Changes the identity of a shift key. By default, the ID for a given
|shiftLabel||Displays the character as secondary on the keyboard key. Most often used
to show what character will be typed when the shift key is held. There is
no way to display more than two labels on a key. This option is only available on iPad.
|shiftLabelPosition||Sets vertical position and horizontal justification of the
|shiftTo||Selects a keyboard layout to display whhen the shift key is pressed. The selected
layout will replace the current layout, based on the
|size||Changes the width of the individual key, relative to a base value of 1.
The following characters are created with the escape character \.
|\b||backspace (hex 08)||\\||backslash (hex 5c)|
|\[||left square bracket (hex 5b)||\]||right square bracket (hex 5d)|
|\r||carriage return (hex 0d)||\x||UTF-8 hexadecimal number; e.g., \x000d for carriage return|
|\t||horizontal tab (hex 09)||\0||octal constant; e.g., \011 for horizontal tab|
Special characters may be used in combination with the
option to create complex sequences:
The following values may be assigned to keys, using the
option. Values not listed have been reserved, and are not available.
|Value||Keyboard Key||Value||Keyboard Key|
|0-255||Equivalent ASCII character1||62587||Back Tab|
|13||Enter||62590||Erase End of Field|
|61716||Up ↑||62598||Cursor Select|
|61717||Down ↓||62599||Field +|
|61718||Right →||62600||Field -|
|61719||Left ←||62601||Field Exit|
|62560-62583||PF1 to PF24||62613||Roll Down|
|62584-62586||PA1 to PA3||62615||Error Reset|
|62592||Redisplay Screen||62609||Enter Record|
|62596||Test Request||62611||Edge Trigger|
|62604||Master Reset||62616||Record Backspace|
|62605||Cent Sign ¢||62617||Last Field Position|
|62607||Erase Field||61903||Next Session|
Putting It All Together
As seen above, there are a variety of options for defining keyboard keys in TinyTERM. Combined, they can create just about any key design needed. Here are three examples from the sample keyboard layout. They all use these default values:
The first argument (here K) is always the key label.
causes the key to send a lower-case k. Without it, the key would send the
label instead, upper-case K. Labeling like this gives an appearance
like that of a physical keyboard.
The last argument,
size, is used to widen the key. The larger size
makes the key easier to type on, and leaves less blank space to either side of the
keyboard. Note also that the K is centered, thanks to the default argument
This key uses
keyChar instead of
keyString to send a
non-printable ASCII 13, which is the carriage return ^M. (It's converted to an
EBCDIC enter in transmission.) The
fontSize argument makes the label text smaller than the default point
labelPosition=6 overrides the default value to left-justify the label string in the lower left
corner of the key. And
size makes the key even wider than the K
key described above.
This key shows a more complex labeling scheme. In addition to the label
Tab, it also has a
shiftLabel string Back. That label is in
shiftLabelPosition=3, putting it just above the main label. With both
shiftFontSize set the same, the key has a
cohesive appearance. Of course, the label and
shiftLabel text could be
reversed, as could their relative positions, to produce the same result.
size value makes the key
narrower than either K or Enter, to the point that it's slightly thinner than square.
Note also that in an actual tn5250.ttkeyboard file, this key definition would be on one line. It's broken in two here for ease of reading.