Export to GitHub

networkpx - keyboard_file_spec.wiki


On iPhoneOS 3.0, every keyboard layout is switched to the UIKeyboardLayoutStar class. The new class allows easy creation of new keyboards using a set of UIKB structural classes. This page is a summary of how what these classes will store when archived.

UIKBKeyboard

struct <UIKBKeyboard> :: | key | type | subtype | meaning | |:--------|:---------|:------------|:------------| | name | string | filename | Keyboard name, also its filename (without the .keyboard part) | | visualStyle | string | {"iPhone-Standard", "iPhone-Alert"} | Keyboard style (optional) | | keyplanes | array | ... of <UIKBKeyplane>s | Keyplanes |

UIKBKeyplane

A keyplane is a single slice of keyboard. Keyplanes can be switched between each other using the shift and more (123/ABC) keys.

struct <UIKBKeyplane> :: | key | type | subtype | meaning | |:--------|:---------|:------------|:------------| | name | string | | Name of keyplane, e.g. Capital-Letters. Case-insensitive. | | keylayouts | array | ...of <UIKBKeylayout>s | Actual geometric layout. | | attributes | dictionary | <UIKBAttributeList> | Attributes. | | supported-types | array | ...of strings | Supported types. The strings must be UIKeyboardTypeX where X is one of

  • Default
  • ASCIICapable
  • NumbersAndPunctuation
  • URL
  • NumberPad
  • PhonePad
  • NamePhonePad
  • EmailAddress
|

UIKBKeylayout

struct <UIKBKeylayout> :: | key | type | subtype | meaning | |:--------|:---------|:------------|:------------| | name | string | | Name of the layout (e.g. Portrait-QWERTY-Capital-Letters-Keylayout) | | keyset | struct | <UIKBKeyset> | Key set. | | refs | array | ...of <UIKBKeylistReference>s | References. |

UIKBKeyset

A keyset contains rows of keylists, which are columns of keys.

struct <UIKBKeyset> :: | key | type | subtype | meaning | |:--------|:---------|:------------|:------------| | name | string | | Name of the keyset (e.g. QWERTY-Capital-Letters-Keyset) | | keylists | array | ...of <UIKBKeylist>s | The rows of keys. |

UIKBKeylist

struct <UIKBKeylist> :: | key | type | subtype | meaning | |:--------|:---------|:------------|:------------| | name | string | | Name of the keylist (e.g. Row1) | | keys | array | ...of <UIKBKey>s | The keys in this row. |

UIKBKey

struct <UIKBKey> :: | key | type | subtype | meaning | |:--------|:---------|:------------|:------------| | name | string | | Name of the key (e.g. Latin-Capital-Letter-Q) | | representedString | string | | The string that will be typed out when tapping this key. | | displayString | string | | The string that is shown on the key. | | displayType | string | {...} | The style of the key, must be one of:

  • Delete
  • DynamicString
  • International
  • More
  • NumberPad
  • Return
  • Shift
  • Space
  • String
  • TopLevelDomain
  • TopLevelDomainVariant
| | interactionType | string | {...} | How the system will respond to a tap. Must be one of:
  • Delete
  • International
  • None
  • Return
  • Shift
  • Space
  • String
  • String-Direct
  • String-Popup
| | variantType | string | {...} | Variants to show for this key. Must of one of:
  • accents (not used)
  • currency
  • URL
  • email
  • immediate-accents
| | attributes | dictionary | <UIKBAttributeList> | Other attributes. |

UIKBKeylistReference

Keylist references are like patches to the keyset. They provide additional detail e.g. the dimensions of the keys.

struct <UIKBKeylistReference> :: | key | type | subtype | meaning | |:--------|:---------|:------------|:------------| | name | string | | Name of the reference (e.g. "Keyset.Row1.Geometry", "Keyset.Row1.Keys[-1].Attributes", etc.) | | value | any | | The value for the keylist to use. | | flags | integer | | ? | | nameElements | array | ...of strings | The name, tokenized by dots. | | startKeyIndex | integer | | If there is a [a:b] in the name, the value of a. | | endKeyIndex | integer | | If there is a [a:b] in the name, the value of b. |

The referenced type can be one of: * UIKBAttributeList * UIKBGeometry * Array of <UIKBGeometry>s.

UIKBGeometry

struct <UIKBGeometry> :: | key | type | subtype | meaning | |:--------|:---------|:------------|:------------| | name | string | | Name of the geometry (e.g. iPhone-Portrait-Alphabetic-Row3-Geometry) | | x-amount | real | | x-location. | | x-unit | integer | | Unit of x-location. 1 = px, 2 = %. | | y-amount | real | | y-location. | | y-unit | integer | | Unit of y-location. 1 = px, 2 = %. | | w-amount | real | | Width. | | w-unit | integer | | Unit of width. 1 = px, 2 = %. | | h-amount | real | | Height. | | h-unit | integer | | Unit of height. 1 = px, 2 = %. | | paddingTop-amount | real | | Top padding. | | paddingTop-unit | integer | | Unit of top padding. 1 = px, 2 = %. | | paddingLeft-amount | real | | Left padding. | | paddingLeft-unit | integer | | Unit of left padding. 1 = px, 2 = %. | | paddingBottom-amount | real | | Bottom padding. | | paddingBottom-unit | integer | | Unit of bottom padding. 1 = px, 2 = %. | | paddingRight-amount | real | | Right padding. | | paddingRight-unit | integer | | Unit of right padding. 1 = px, 2 = %. | | explicit | boolean | | ? |

UIKBAttributeList

struct <UIKBAttributeList> :: | key | type | subtype | meaning | |:--------|:---------|:------------|:------------| | name | string | | Name of the attribute list. Usually empty. | | list | array | ...of <UIKBAttribute>s | The actual list of attributes. | | explicit | boolean | | ?? |

UIKBAttribute

struct <UIKBAttribute> :: | key | type | subtype | meaning | |:--------|:---------|:------------|:------------| | name | string | | Name of the attribute. | | value | any | | Value of the attribute. |

The defined attributes are: | name | value type | for | meaning | |:---------|:---------------|:--------|:------------| | adaptive-keys | boolean | Keyplane | Use "adaptive keys" or not. Usually true for alphabet plane and false for numbers & symbols plane. | | autoshift | boolean | Keyplane | Enables auto-shift (e.g. enables shift after a full-stop). | | label | | | | | looks-like-shift-alternate | boolean | Keyplane | This plane and the shift plane look like each other. | | more-after | boolean | Key | Immediately press the more key automatically after this key is pressed. Usually enabled on the apostrophe (') key. | | more-alternate | string (keyplane name) | Keyplane | The name of keyplane to switch to after tapping the More key. | | more-rendering | string ({...}) | Keyplane | What strings should be shown on the More key.

  • numbers = @123
  • symbols = .?123
  • letters = ABC
  • phonepad = 123
| | popup-bias | {"left", "right"} | Key | Whether the popup (the large letter) to point to the left or right (or center by default). | | shift | boolean | Keyplane | Whether this keyplane is a shifted one. | | shift-after | boolean | Key | Immediately press the shift key automatically after this key is pressed. Used a lot on the Zhuyin keyboard. | | shift-alternate | string (keyplane name) | Keyplane | The name of keyplane to switch to after tapping the Shift key. | | shift-is-plane-chooser | boolean | Keyplane | When true, the shift key will act as a caps-lock-like key. | | shift-rendering | string ({...}) | Keyplane | What string should be shown on the Shift key.
  • numbers = 123
  • symbols = #+=
  • letters = ⇧
  • glyph = ?????

shouldskipcandidateselection boolean Keyplane ? state {"enabled", "disabled"} Key Whether a key is enabled or not. Used in PhonePad keyboard. supported-types array of strings? Keyplane Not used. variant-popup-bias {"left", "right"} Key Whether the variants popup should expand to the left or right. variant-type string Key Not used? visible boolean? Not used.

These are attributes for various internal layouts:

name
keyplane Latin, (Default),
Capital-Letters Latin, (Default),
Small-Letters Latin, (Default),
Numbers-And-Punctuation Latin, (Default),
Numbers-And-Punctuation-Alternate Latin, (PhonePad)
Default Latin, (PhonePad)
Alternate autoshift ✓ ✓ ✗ ✗ ✗ ✗ adaptive-keys ✓ ✓ ✗ ✗ ✗ ✗ looks-like-shift-alternate ✓ ✓ ✗ ✗ ✗ ✗ shift yes no no yes no yes shift-alternate small-letters capital-letters numbers-and-punctuation-alternate numbers-and-punctuation alternate default shift-is-plane-chooser ✓ ✓ shift-rendering glyph symbols numbers letters numbers shouldskipcandidateselection ✓ ✓ more-alternate numbers-and-punctuation numbers-and-punctuation small-letters small-letters more-rendering numbers numbers letters letters

name
keyplane Thai, (Default),
Shifted-Letters Thai, (Default),
Letters Hebrew, (Default)
Letters autoshift ✗ ✗ ✗ adaptive-keys ✓ ✓ ✓ looks-like-shift-alternate ✗ ✗ ✓ shift yes no no shift-alternate letters shifted-letters shift-is-plane-chooser ✓ ✓ ✗ more-alternate numbers-and-punctuation numbers-and-punctuation numbers-and-punctuation more-rendering numbers numbers numbers