ViewML Industrial Browser for iOS includes several keyboard layouts, which can replace or
supplement the device's on-screen keyboard or an external keyboard. These layouts
include custom multinational keyboards. Each of the main layouts includes
function keys and other terminal keys such as Insert and End, though these are seldom
used by websites.
Creating a Keyboard Layout
It's also possible to create additional keyboard layouts and
upload them to ViewML.
Keyboard layouts are defined in a UTF-8 text file. For example, the
"PC English with Fn Keys" layout for portrait mode is defined with this code:
-spacing 2
-margin 1
-labelPosition 4
+PC English with Fn Keys.P
#PC-style keyboard
-keyboardHeight 264
-orientation 1
-layout 0
-keyHeight 0.9
-fontSize 12
-shiftFontSize 11
[Esc;;keyChar=27][Blank;;blank=1;;size=0.11][F1;;keyChar=63236][F2;;keyChar=63237][F3;;keyChar=63238][F4;;keyChar=63239][Blank;;blank=1;;size=0.11][F5;;keyChar=63240][F6;;keyChar=63241][F7;;keyChar=63242][F8;;keyChar=63243][Blank;;blank=1;;size=0.11][F9;;keyChar=63244][F10;;keyChar=63245][F11;;keyChar=63246][F12;;keyChar=63247][Blank;;blank=1;;size=0.11][Ins;;keyChar=300][Del;;keyChar=301][Blank;;blank=1;;size=0.11][Home;;keyChar=63273][End;;keyChar=63275][Blank;;blank=1;;size=0.11][PgUp;;keyChar=296][PgDn;;keyChar=295]
-keyHeight 1.2
-fontSize 20
-shiftLabelPosition 0
[`;;size=1.12;;shiftLabel=~][1;;size=1.45;;shiftLabel=!][2;;size=1.45;;shiftLabel=@][3;;size=1.45;;shiftLabel=#][4;;size=1.45;;shiftLabel=$][5;;size=1.45;;shiftLabel=%][6;;size=1.45;;shiftLabel=^][7;;size=1.45;;shiftLabel=&][8;;size=1.45;;shiftLabel=*][9;;size=1.45;;shiftLabel=(][0;;size=1.45;;shiftLabel=)][-;;size=1.45;;shiftLabel=_][=;;size=1.45;;shiftLabel=+][?;;keyChar=8;;size=1.6]
[Tab;;keyChar=9;;size=1.62;;labelPosition=6;;fontSize=11][Q;;keyString=q;;size=1.45][W;;keyString=w;;size=1.45][E;;keyString=e;;size=1.45][R;;keyString=r;;size=1.45][T;;keyString=t;;size=1.45][Y;;keyString=y;;size=1.45][U;;keyString=u;;size=1.45][I;;keyString=i;;size=1.45][O;;keyString=o;;size=1.45][P;;keyString=p;;size=1.45][\[;;size=1.45;;shiftLabel={][\];;size=1.45;;shiftLabel=}][\\;;size=1.1;;shiftLabel=|]
[Caps;;capsKey=1;;fontSize=11;;labelPosition=6;;size=1.98][A;;keyString=a;;size=1.45][S;;keyString=s;;size=1.45][D;;keyString=d;;size=1.45][F;;keyString=f;;size=1.45][G;;keyString=g;;size=1.45][H;;keyString=h;;size=1.45][J;;keyString=j;;size=1.45][K;;keyString=k;;size=1.45][L;;keyString=l;;size=1.45][; ;;size=1.45;;shiftLabel=:][';;size=1.45;;shiftLabel="][Enter;;size=2.2;;keyChar=13;;labelPosition=6;;fontSize=11]
[Shift;;fontSize=11;;labelPosition=6;;shiftTo=PC English with Fn Keys.P.fnshift;;size=2.77][Z;;keyString=z;;size=1.45][X;;keyString=x;;size=1.45][C;;keyString=c;;size=1.45][V;;keyString=v;;size=1.45][B;;keyString=b;;size=1.45][N;;keyString=n;;size=1.45][M;;keyString=m;;size=1.45][,;;size=1.45;;shiftLabel=<][.;;size=1.45;;shiftLabel=>][/;;size=1.45;;shiftLabel=?][Shift;;fontSize=11;;labelPosition=6;;shiftTo=PC English with Fn Keys.P.fnshift;;size=2.9]
[10 Key;;fontSize=11;;labelPosition=6;;shiftLock=PC English with Fn Keys.P.fnkeypad;;size=1.19][Abc;;fontSize=11;;labelPosition=6;;shiftLock=PC English with Fn Keys.P.none;;size=1.19][Ctrl;;shiftTo=PC English with Fn Keys.P.fnctrl;;labelPosition=6;;size=1.19;;fontSize=11][BLANK;;size=0.35;;blank=1][ ;;keyChar=32;;size=9.25][BLANK;;size=0.35;;blank=1][?;;keyChar=63234;;size=1.18][?;;keyChar=63233;;size=1.18][?;;keyChar=63232;;size=1.18][?;;keyChar=63235;;size=1.18][BLANK;;blank=1;;size=.4][BLANK;;size=.4;;blank=1][Hide;;hideKey=1;;size=1.18]
Each line of the definition creates a single row of keys.
The above code corresponds to this keyboard layout:
The first three arguments control the general appearance of all keyboard layouts
in the .ttkeyboard file that come after those settings. Any layout before those
settings will not be affected by them.
The next important argument is the keyboard name, in this case
+PC English with Fn Keys.P
.
The +
sign identifies the start of a new keyboard layout.
The .P
tag means this layout will only display in the list of
keyboards when the iPad is in portrait orientation. Neither the +
nor the .P
displays as part of the layout name.
If there is an extension on the keyboard name, such as
+PC English with Fn Keys.P.shift
, the layout name will not be displayed in TinyTERM at all.
Instead, the layout can only be accessed through shift
arguments in other keyboard layouts.
Everything after the layout name is considered part of the individual layout,
until another +
sign is reached.
Lines starting with the # symbol are comments. Nothing here will be displayed as
part of the layout.
The remaining lines are the actual key definitions. If the keys have no size arguments,
they will be resized to fit the available space.
Defining Keys
There are three ways to define a key:
- A single character
A single character outside brackets will display as a separate key. For example, the
string qwertyuiop
would display as one key per letter.
Lower-case letters used like this are displayed in upper case for the key labels,
making the keys look more like those on a physical keyboard. They still send as
lower-case when typed.
- Enclosed within square brackets [ ]
The value [Esc;;keyChar=27]
is one key. The key label is
Esc
, and the value assigned is keyChar=27
. That
corresponds to ASCII value 27, the Escape key.
This is also how to label a key with more than one character. For example, the
Break key could simply be defined with
[Break]
. A key defined with only a label will send that label as a
text string when pressed.
- Preceded by the escape character
\
The key definition [\\;;size=1.1;;shiftLabel=|]
includes \\
as one of these. Because certain characters are used in
key definitions, they
must be escaped with \
to be used as themselves.
ViewML uses two keyboard files, one for iPad and one for iPhone or iPod Touch.
The keys.ttkeyboard
files, and a complete listing of the available key options,
are available from this page.
Using a Custom Keyboard Layout
Once a keyboard layout has been created, it needs to be saved in a text file in
UTF-8 format. This makes virtually any character available to the ViewML
keyboard. A number of text editors include a UTF-8 option. The file must have the appropriate
name to be recognized by the appropriate emulator.
Only one keyboard layout file can be active at a time. To use the layouts from
more than one .ttkeyboard file, combine them into a single file.
Once the .ttkeyboard file is created, it needs to be uploaded to ViewML.
Instructions for that can be found here.