feat(core): ldml: updates to C7043.1 spec 🙀

- merge all but the kitchen sink into layr element :)
- update numbers
This commit is contained in:
Steven R. Loomis 2022-11-04 13:24:05 -05:00
parent f140093088
commit a9daefb293

View file

@ -324,31 +324,30 @@ For each key:
- `vkey`: Is the standard vkey, 0-255
- `target`: Is the target (resolved) vkey, 0-255.
### C7043.2.x `lyrs`—Layers list
### C7043.2.13 `layr`—Layers list
Represents layers on the keyboard. There may be multiple layer lists,
corresponding to different form factors and hardware types.
Represents layers on the keyboard.
- Each key entry corresponds to a key on the row
| ∆ | Bits | Name | Description |
|---|------|------------|------------------------------------------|
| 0 | 32 | ident | `lyrs` |
| 0 | 32 | ident | `layr` |
| 4 | 32 | size | int: Length of section |
| 8 | 32 | count | int: Number of layer lists |
|12 | 32 | layerstart | int: offset to first layer entry |
|16 | 32 | layercount | int: number of layer entries |
|20 | 96 | reserved | padding |
| 8 | 32 | listCount | int: Number of layer lists |
|12 | 32 | layerCount | int: number of layer entries |
|16 | 32 | rowCount | int: number of row entries |
|20 | 32 | keyCount | int: number of key entries |
|24 | 64 | reserved | padding |
Note: `layerstart` must point after the end of the layer lists
Each layer list corresponds to one `<layers>` element.
There are `listCount` total lists.
For each 'layers' - the layer lists
| ∆ | Bits | Name | Description |
|---|------|------------|------------------------------------------|
|16+| 32 | flags | int: per-layers options |
|24+| 32 | hardware | str: layout (`us`,`iso`,`jis`,`abnt2`) |
|28+| 32 | layer | int: index to first layer element |
|32+| 32 | layerCount | int: number of layer elements in list |
|36+| 96 | reserved | short`[3]`: padding |
| ∆ | Bits | Name | Description |
|---|------|------------|--------------------------------------------|
| 0+| 32 | flags | int: per-layers options |
| 4+| 32 | hardware | str: layout (`us`,`iso`,`jis`,`abnt2`) |
| 8+| 32 | layer | int: index to first layer element |
|12+| 32 | count | int: number of layer elements in this list |
- `flags`: a 32-bit bitfield defined as below:
@ -357,59 +356,32 @@ For each 'layers' - the layer lists
| 0 | form | 0: hardware  |
| 0 | form | 1: touch |
For each layer element
Each layer entry corresponds to one `<layer>` element
There are `layerCount` total layer entries.
| ∆ | Bits | Name | Description |
|---|------|------------|------------------------------------------|
|16+| 32 | id | str: layer id such as `base` or `shift` |
|24+| 32 | modifier | str: modifier string |
|28+| 32 | row | int: `rows` identifier of first row |
|32+| 32 | rowCount | int: number of `rows` elements |
| 0+| 32 | id | str: layer id such as `base` or `shift` |
| 4+| 32 | modifier | str: modifier string |
| 8+| 32 | row | int: index into rows area (next section) |
|12+| 32 | count | int: number of `rows` elements for this layer |
### C7043.2.x `rows`—Row list
Each row entry corresponds to one `<row>` element
There are `rowCount` total row entries.
Each list is a row of keys in the `key2` element
| ∆ | Bits | Name | Description |
|---|------|------------|----------------------------------------|
| 0+| 32 | key | int: index into key element |
| 4+| 32 | key2count | int: count of key elements in this row |
Each key entry corresponds to a key in the row.
There are `keyCount` total key entries.
| ∆ | Bits | Name | Description |
|---|------|---------|------------------------------------------|
| 0 | 32 | ident | `rows` |
| 4 | 32 | size | int: Length of section |
| 8 | 32 | count | int: Total number of row list elements |
|12 | 32 | reserved| padding |
| 0+| 32 | vkey | int: vkey ID |
> TODO-LDML: Should there be a '0-key2count terminator'?
For each 'row' list element
| ∆ | Bits | Name | Description |
|---|------|------------|------------------------------------------|
|16+| 32 | key2 | int: index into `key2` element |
|24+| 32 | key2count | int: count of `key2` elements |
### C7043.2.x `key2`—Secondary key list
This is a list of vkeys, but ordered by rows. The `rows` elements point into the start and length of entries here.
> TODO-LDML: Should there be a '0-vkey terminator'?
> And shold the 0th element also be a 0 vkey so that key2=0 means null?
| ∆ | Bits | Name | Description |
|---|------|---------|------------------------------------------|
| 0 | 32 | ident | `key2` |
| 4 | 32 | size | int: Length of section |
| 8 | 32 | count | int: Total number of key2 elements |
|12 | 32 | reserved| padding |
For each `key2` element:
Note that the first two fields are the index into the `keys` element, except arranged according to the keyboard layout.
| ∆ | Bits | Name | Description |
|---|------|---------|------------------------------------------|
|16+| 32 | vkey | int: vkey ID |
|20+| 32 | mod | int: modifier key flags |
### C7043.2.x `disp`—Display list
### C7043.2.14 `disp`—Display list
| ∆ | Bits | Name | Description |
|---|------|---------------|------------------------------------------|
@ -430,8 +402,6 @@ For each element:
Entries are sorted in a binary codepoint sort on the `to` field.
## TODO-LDML: various things that need to be completed here or fixed in-spec
> * UnicodeSets