The Onscreen Keyboard

TinyTERM for Windows includes the option to display an onscreen keyboard below the main window. This requires that a layout file with the extension .ttkeyboard be in the user's Documents\TinyTERM folder in Windows. The file must then be referenced by the frameKeyboardFile argument in the tpx file.

The onscreen keyboard can be selected, or turned on and off, via the frameKeyboard setting in the tpx file. Three layouts are included in the sample frame.ttkeyboard file:

  • UNIX: provides F1-F12, and the standard island and arrow keys
  • TN3270: provides F1-F12, as well as several 3270 special functions
  • TN5250: provides F1-F12, as well as several 5250 special functions

This file is also available in the C:\Program Files (x86)\Century\TinyTERM folder.




Creating an Onscreen Keyboard Layout

It's also possible to create additional button bar layouts by editing the frame.ttkeyboard file. Before making any changes to this file, make a backup copy so the original settings can be restored if needed. You can also download a copy here.

frame.ttkeyboard is an ASCII text file that contains the existing onscreen keyboard layouts. For example, the UNIX layout is defined like this:

-spacing 3
-margin 5
-fontSize 30

+UNIX
-keyboardHeight 100
[F1;;keyChar=256][F2;;keyChar=257][F3;;keyChar=258][F4;;keyChar=259][F5;;keyChar=260][F6;;keyChar=261][BLANK;;size=.2;;blank=1][Ins;;keyChar=300][Home;;keyChar=280][PgUp;;keyChar=296][BLANK;;size=.2;;blank=1][BLANK;;blank=1][Up;;keyChar=276][BLANK;;blank=1]
[F7;;keyChar=262][F8;;keyChar=263][F9;;keyChar=264][F10;;keyChar=265][F11;;keyChar=266][F12;;keyChar=267][BLANK;;size=.2;;blank=1][Del;;keyChar=301][End;;keyChar=298][PgDn;;;;keyChar=295][BLANK;;size=.2;;blank=1][Left;;keyChar=279][Down;;keyChar=277][Right;;keyChar=278]

Each line of key definitions generates a single row of keys. The above has one line, which corresponds to this button bar:

The first three arguments control the general appearance the button bar, regardless of the layout selected.

  • -spacing is the number of pixels between keys
  • -margin is the minimum number of pixels for spacing from each edge of the keyboard
  • -fontSize is the maximum size of the primary key labels

The next important argument is the keyboard name, in this case +UNIX. The + sign identifies the start of a new keyboard. It does not display as part of the layout name, nor is it needed by the frameKeyboard argument.

Following that is the -keyboardHeight argument. This sets the number of pixels for the keyboard's height. It can be set in the general settings above, if desired. If it were, this option would override it.

Everything after the name is considered part of the keyboard layout, until another + sign is reached. There also needs to be one full blank line after each layout, even if it's at the end of the frame.ttkeyboard file.

Lines can also be started with the # symbol, to create comments. They will not be displayed as part of the layout.

The remaining lines are the actual key definitions. A keyboard layout may include any number of rows of keys. These will be placed in the available space at the best fit possible.




Defining Keys

There are three ways to define a key:

  • A single typed character
    Any single ASCII character placed by itself in a keyboard row will generate a key for that character

  • Enclosed within square brackets [ ]
    The function keys in the example above are all defined this way. Each section of the key definition is set off with two semicolons ;; with the key label as the first argument.

  • Preceded by the escape character \
    Because certain characters are used in key definitions, they must be escaped to be used as individual keys. The \ also indicates octal or hexadecimal values, or special characters in a key sequence.

A reference guide to all arguments available for onscreen keyboard layouts is available here.




Using a Custom Keyboard Layout

Once a new layout has been added to frame.ttkeyboard, the file must be saved in ASCII format. The new layouts will be available the next time a given .tpx file is opened.


Back to TinyTERM Plus for Windows documentation index