Version 1

Solartech Screen Keyboard Format

Source Format

Keyboards will be specified by a description file and some accompanying images (specified by name in the description file).

Description File

The description file will be a utf-8 text file. The first line of the file will be the name of the keyboard set being defined (suitable for presentation to the user in a menu). The rest of the description file will contain rfc822-style "key: value" pairs. Valid keys will be:

keyboard
Specifies a unique identifier for the keyboard. This will be in effect until another "keyboard" keyword is found. The first keyboard found will be the default keyboard for this keyboard set.
graphic
The graphic for the keyboard, which presents the basic graphic when nothing is active. Applies to the most recently specified keyboard.
brightness-min
The preferred minimum brightness for this keyboard. Units are 0 (pure dark) to 10,000 (bright sunny day). Note: this value is merely advisory. This applies to the most recently defined graphic.
brightness-max
The preferred maximum brightness for this keyboard. Units are 0 (pure dark) to 10,000 (bright sunny day). Note: this value is merely advisory. This applies to the most recently defined graphic.
action-color
The color to draw over the key to indicate that it's being pressed. This applies to the most recently defined graphic.
action-map
The action map defines rectangular regions in the main graphic and what should be done when they're clicked (format described below). Action maps are associated to the most recently defined graphic.

Action Maps

Action maps are utf-8 files which define rectangles and the corresponding actions to take when a click is registered in them. Rectangles and their associated action are specified one per line. The rectangle is four numbers (offsets from the upper left), specifying the top-left and bottom-right coordinates of the action rectangle. They are specified in decimal and separated by commas.

The action is specified, sollowing whitespace, in square brackets. Valid actions are:

code: 0xNNNN
a unicode code to insert
char: [character]
a unicode character to insert; this generates the same action as code: 0xNNNN with the corresponding code, but may be more convenient.
keyboard: name
causes the current keyboard to be replaced by the specified keyboard. "name" is the unique identifier of the keyboard to replace.

For example:

10,4,27,16 [code: 0x0051]
30,4,47,16 [char: W]
10,138,34,152 [keyboard: lowercase]

Compiled Format

The keyboard sources are compiled into a binary format to be more compact and easier for java to read. All multi-byte integers are big-endian unless otherwise specified, and the type String is defined to be an unsigned short indicating the number of bytes in the string, followed by that many bytes of utf-8 data.

Compiled Keyboard Set Format
Byte Count Data Type Value Description
1 Unsigned Byte 0 Keyboard Format Version
2-65537 String The name of this keyboard set (suitable for showing to the user in a menu).
2 Unsigned Short (count) the number of keyboards in this keyboard set
variable Keyboard[count] the keyboards
Keyboard
Byte Count Data Type Value Description
2-65537 String The name of this keyboard (used by action maps, not presented to the user).
1 unsigned byte (count) the number of keyboard graphics (and associated information) for this keyboard.
variable KeyboardGraphic[count] the keyboard graphics
KeyboardGraphic
Byte Count Data Type Value Description
2-65537 String the name of the PNG containing the graphic to be displayed (unmodified) as the keyboard
2 unsigned short brightness min
2 unsigned short brightness max
1 unsigned byte action color (red component)
1 unsigned byte action color (green component)
1 unsigned byte action color (blue component)
1 unsigned byte (count) the number of action mappings for this graphic.
variable ActionMapping[count] the actionmapping the keyboard graphics
ActionMapping
Byte Count Data Type Value Description
2 unsigned short x coordinate of upper left corner
2 unsigned short y coordinate of upper left corner
2 unsigned short x coordinate of lower right corner
2 unsigned short y coordinate of lower right corner
1 unsigned byte Action. 0 == insert code, 1 = switch to keyboard
2 unsigned short unicode code or length of string
0-65535 utf-8 data If the action is a keyboard switch, this is the utf-8 name of the keyboard (in this set) to switch to.

Christopher Lansdown
Last modified: Wed Jun 22 17:31:16 EDT 2005