Keyboards will be specified by a description file and some accompanying images (specified by name in the 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:
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:
For example:
10,4,27,16 [code: 0x0051]
30,4,47,16 [char: W]
10,138,34,152 [keyboard: lowercase]
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.
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 |
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 |
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 |
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. |