-
Notifications
You must be signed in to change notification settings - Fork 4
Overlay File Format
This is a work in progress for documenting the overlay layout files used by the IntelliKeys software. Please add and correct details.
There are at least three different file extensions for overlay files, but it appears all of them starts with overlay data in the same format. A guess is that the data at the end of the file might be used for editing.
An overlay file is a list of membrane regions and which keys each respective region activates. The list can be split into modes/levels such that a membrane region sends different events depending on the mode.
The code for parsing the overlay files is in source files named IKOverlay, IKDevice and IKUniversal.
The file contents starting at the beginning of the file is:
| Size | Description |
|---|---|
| 2 bytes LE |
Length The number of bytes in the command lookup table, including length and checksum. At most 0x7200= 29184 bytes. |
| 2 bytes LE | Checksum A 16-bit sum of all bytes in command table. |
| Length-4 bytes | The command table. It describes how membrane presses and switches should be converted to keyboard and mouse input. See tables below for encoding. |
| 32 bytes | Name The name of the overlay file, encoded as command data. E.g. upper case ‘A’ is encoded as ‘Shift+A’. |
| 1 byte | Unknown/Number Is always 0? |
| 1 byte | NumberOfLevels An overlay can switch between up to 16 different modes, called levels in the code. This changes how membrane presses are converted to key inputs. |
| 1 byte | Unknown/SetupFlag Is always 0? |
| 1 byte | Unknown/CoordMode Is always 0? |
| 4 bytes | Unused/Reserved |
| 16 bytes | Unknown/BaseLevel |
| 16 bytes | Unknown/MouseLevel |
| 2 bytes BE | OffsetLevel0 Offset of command table for mode/level 0. Offset in bytes from start of file. |
| 2 bytes BE | OffsetLevel1 Offset of command table for mode/level 1. Offset in bytes from start of file. |
| ... | ... |
| 2 bytes BE | OffsetLevel15 Offset of command table for mode/level 15. Offset in bytes from start of file. |
| ? | Any data after the above structure is not used by the command processing. |
The command table is a list of when each command is triggered and what to do when it is triggered. It is encoded as a repeated list of the following:
| Size | Description |
|---|---|
| 1 byte |
Domain A unique number of the command, duplicates are not expected. 0 Indicates the last command in the list. Must not be 0xff for switches. |
| 2 bytes |
MembraneLocation/SwitchNumber If the first byte is any of {255, 254, 253, 252, 251, 250} it matches switch 1 through 6 respectively. Otherwise it is a bit-encoded rectangle on the membrane. The first byte is the x offset and length. The second byte is the y offset and length. The offset and length are encoded in each byte using the 3 most significant bits for length, l, and the 5 least significant bits for offset, o:0blllooooo
|
| ? bytes | CommandData A list of actions to perform when the command is triggered. Each action is encoded as one or more non-zero bytes. The last action is end-of-actions. |
The action list for each command can be one key or a list of keys. If it is one key it behaves as a regular keyboard, otherwise it behaves as each key is typed one after the other. There are also special actions for mouse movement and changing the keyboard settings. The following table lists all known actions.
| Byte value | Action/Key |
|---|---|
0x00 |
End of the action list |
0x01 |
F1 |
0x02 |
F2 |
0x03 |
F3 |
0x04 |
F4 |
0x05 |
F5 |
0x06 |
F6 |
0x07 |
F7 |
0x08 |
F8 |
0x09 |
F9 |
0x0A |
F10 |
0x0B |
F11 |
0x0C |
F12 |
0x0D |
Print Screen |
0x0E |
Scroll Lock |
0x0F |
Pause |
0x10 |
Numpad 0 |
0x11 |
Numpad 1 |
0x12 |
Numpad 2 |
0x13 |
Numpad 3 |
0x14 |
Numpad 4 |
0x15 |
Numpad 5 |
0x16 |
Numpad 6 |
0x17 |
Numpad 7 |
0x18 |
Numpad 8 |
0x19 |
Numpad 9 |
0x1A |
Numpad + |
0x1B |
Numpad - |
0x1C |
Numpad × |
0x1D |
Numpad ÷ |
0x1E |
Numpad = |
0x1F |
Numpad ⏎ |
0x20 |
Space |
0x21 |
Numpad . |
0x22 |
Insert |
0x23 |
Delete |
0x24 |
Up Arrow |
0x25 |
Down Arrow |
0x26 |
Left Arrow |
0x27 |
Right Arrow |
0x28 |
Home |
0x29 |
End |
0x2A |
Page Up |
0x2B |
Page Down |
0x2C |
, |
0x2D |
- |
0x2E |
. |
0x2F |
/ |
0x30 |
0 |
0x31 |
1 |
0x32 |
2 |
0x33 |
3 |
0x34 |
4 |
0x35 |
5 |
0x36 |
6 |
0x37 |
7 |
0x38 |
8 |
0x39 |
9 |
| - | |
0x3B |
; |
| - | |
0x3D |
= |
0x3E |
~ |
0x3F |
" |
| - | |
0x41 |
A |
0x42 |
B |
0x43 |
C |
0x44 |
D |
0x45 |
E |
0x46 |
F |
0x47 |
G |
0x48 |
H |
0x49 |
I |
0x4A |
J |
0x4B |
K |
0x4C |
L |
0x4D |
M |
0x4E |
N |
0x4F |
O |
0x50 |
P |
0x51 |
Q |
0x52 |
R |
0x53 |
S |
0x54 |
T |
0x55 |
U |
0x56 |
V |
0x57 |
W |
0x58 |
X |
0x59 |
Y |
| ... | |
0x60 |
Enter/Return |
0x61 |
Escape |
0x62 |
Tab |
0x63 |
Backspace |
0x64 |
Caps Lock |
0x65 |
Num Lock |
| - | |
0x67,0xhh,0xll
|
UCS-2 encoding (?) of code point 0xhhll? Win only |
| ... | |
0x70 |
Shift |
0x71 |
Right Shift |
0x72 |
Control |
0x73 |
Right Control |
0x74 |
Alt, Meny, Option |
0x75 |
Alt Gr, Right Option |
0x76 |
Command |
| ... | |
0x80 |
Mouse move up |
0x81 |
Mouse move up+right |
0x82 |
Mouse move right |
0x83 |
Mouse move down+right |
0x84 |
Mouse move down |
0x85 |
Mouse move down+left |
0x86 |
Mouse move left |
0x87 |
Mouse move up+left |
0x88 |
Mouse click |
0x89 |
Mouse double click |
0x8A |
Mouse button down |
0x8B |
Mouse button up |
0x8C |
Mouse on |
0x8D |
Mouse off |
0x8E |
Mouse toggle |
0x8F |
Mouse right button click |
0x90 |
Mouse right button double click |
0x91 |
Mouse right button down |
0x92 |
Mouse right button up |
0x93 |
Mouse right button toggle |
0x94 |
Mouse middle button click |
0x95 |
Mouse middle button double click |
0x96 |
Mouse middle button down |
0x97 |
Mouse middle button up |
0x98 |
Mouse middle button toggle |
0x99 |
Mouse button 4 click |
0x9A |
Mouse button 4 double click |
0x9B |
Mouse button 4 down |
0x9C |
Mouse button 4 up |
0x9D |
Mouse button 4 toggle |
0x9E |
Mouse button 5 click |
0x9F |
Mouse button 5 double click |
0xA0 |
Mouse button 5 down |
0xA1 |
Mouse button 5 up |
0xA2 |
Mouse button 5 toggle |
0xA3 |
Mouse button 6 click |
0xA4 |
Mouse button 6 double click |
0xA5 |
Mouse button 6 down |
0xA6 |
Mouse button 6 up |
0xA7 |
Mouse button 6 toggle |
0xA8 |
Mouse button 7 click |
0xA9 |
Mouse button 7 double click |
0xAA |
Mouse button 7 down |
0xAB |
Mouse button 7 up |
0xAC |
Mouse button 7 toggle |
0xAD |
Mouse button 8 click |
0xAE |
Mouse button 8 double click |
0xAF |
Mouse button 8 down |
0xB0 |
Mouse button 8 up |
0xB1 |
Mouse button 8 toggle |
0xB2 |
Wait. Pauses input for 1 second. |
| ... | |
0xC0 |
Switch to overlay mode/level 0. |
0xC1 |
Switch to overlay mode/level 1. |
0xC2 |
Switch to overlay mode/level 2. |
0xC3 |
Switch to overlay mode/level 3. |
0xC4 |
Switch to overlay mode/level 4. |
0xC5 |
Switch to overlay mode/level 5. |
0xC6 |
Switch to overlay mode/level 6. |
0xC7 |
Switch to overlay mode/level 7. |
0xC8 |
Switch to overlay mode/level 8. |
0xC9 |
Switch to overlay mode/level 9. |
0xCA |
Switch to overlay mode/level 10. |
0xCB |
Switch to overlay mode/level 11. |
0xCC |
Switch to overlay mode/level 12. |
0xCD |
Switch to overlay mode/level 13. |
0xCE |
Switch to overlay mode/level 14. |
0xCF |
Switch to overlay mode/level 15. |
0xD0 |
Non repeating. |
0xD1 |
Repeat last command. |
0xD2 |
Non-smart typing. Not supported? |
| ... | |
0xE0,0x32,0xrr
|
Set data send rate to 0xrr
|
0xE0,0x33
|
Display features |
0xE0,0x41,0xrr
|
Set response rate to 0xrr
|
0xE0,0x42
|
Require lift off: on |
0xE0,0x43
|
Require lift off: off |
0xE0,0x44
|
Sound: off |
0xE0,0x45
|
Sound: on |
0xE0,0x47
|
Repeat: on |
0xE0,0x48
|
Repeat: off |
0xE0,0x49,0xrr
|
Set repeat rate to 0xrr
|
0xE0,0x4A
|
Repeat latching: on |
0xE0,0x4B
|
Repeat latching: off |
0xE0,0x4C
|
Shift latching |
0xE0,0x4D
|
Shift locking |
0xE0,0x4E
|
No shift latching |
0xE0,0x51
|
3 Indicator lights |
0xE0,0x52
|
6 Indicator lights |
0xE0,0x53
|
Smart typing: On |
0xE0,0x54
|
Smart typing: Off |
0xE0,0x55,0xrr
|
Set mouse speed to 0xrr
|
0xE0,0x56
|
Ignored? Mouse arrow: On |
0xE0,0x57
|
Ignored? Mouse arrow: Off |
0xE0,0x58,0xrr
|
Ignored? Custom mode/level |
0xE1,0x45
|
Reset to default settings |
0xE1,0x53
|
Toggle smart typing |