Skip to content

Commit

Permalink
CLDR-17113 kbd: element/attr renaming (#3313)
Browse files Browse the repository at this point in the history
* CLDR-17113 kbd: element/attr renaming

- layers/@Form > layers/@formid
- key/@flicks > key/@flickId
- key/@switch >  key/@layerId
- key/@to > key/@output
- display/@to > display/@output

- updates to dtd, samples
- drop some old data in tests

* CLDR-17113 kbd display output= and display= should support variables

* CLDR-17113 kbd shuffle element deck chairs

- longPress, multiTap now use a new keyList id
- keyList is a list of keys, has a default key
- flickSegment now uses a keyId instead of output

This means that each part of longPress, flick, and multiTap can:
- have a <display> customization
- perform a layer switch if desired

Also, document.

* CLDR-17113 kbd: move keyList back into attributes

* CLDR-17113 kbd: add longPressDefaultKeyId

- replaces longPressDefault=true

* CLDR-17113 kbd: no nested gestures

* CLDR-17113 kbd: no nested gestures,2
  • Loading branch information
srl295 authored Oct 11, 2023
1 parent e58b346 commit 5f1d298
Show file tree
Hide file tree
Showing 18 changed files with 456 additions and 406 deletions.
2 changes: 0 additions & 2 deletions common/supplemental/attributeValueValidity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,6 @@
<attributeValues dtds='ldml' elements='relativeTimePattern' attributes='count' type='localeSpecific'>pluralOrdinal</attributeValues>
<attributeValues dtds='ldml' elements='unitPattern' attributes='count' type='localeSpecific'>pluralOrdinal</attributeValues>
<attributeValues dtds='keyboard3' elements='keyboard3' attributes='locale' type='TODO'></attributeValues>
<!-- <attributeValues dtds='keyboard3' elements='map' attributes='longPress' type='TODO'></attributeValues>
<attributeValues dtds='keyboard3' elements='map' attributes='to' type='TODO'></attributeValues> -->
<attributeValues dtds='keyboard3' elements='info' attributes='name' type='TODO'></attributeValues>
<attributeValues dtds='keyboard3' elements='transform' attributes='from' type='TODO'></attributeValues>
<attributeValues dtds='keyboard3' elements='transform' attributes='to' type='TODO'></attributeValues>
Expand Down
202 changes: 123 additions & 79 deletions docs/ldml/tr35-keyboards.md

Large diffs are not rendered by default.

83 changes: 53 additions & 30 deletions keyboards/3.0/fr-t-k0-azerty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@
<!-- Note: displays is only used for keycap presentation -->
<!-- this example is not required for this keyboard as we use the spacing
modifiers -->
<display to="\u{0300}" display="${grave}" /> <!-- display combining grave as modifier letter grave ˋ -->
<display output="\u{0300}" display="${grave}" /> <!-- display combining grave as modifier letter grave ˋ -->
<!-- Note: We discussed why the existing displayMap was used for display.
rather than adding something closer to the key layout. 1. This way we can
tell the renderer what to do. Could be double diacritics, spacing issues,
etc. 2. We expect that keys have output. Otherwise the input content is malformed.
3. Don't Repeat Yourself : multiple keys (i.e. on different symbol layers)
may have the same display. -->

<!-- Example of a display mapping for a key by id -->
<display keyId="symbol" display="@" />
<display keyId="numeric" display="123" />
<displayOptions baseCharacter="x" />
</displays>

Expand All @@ -37,10 +41,10 @@
<import base="cldr" path="techpreview/keys-Zyyy-currency.xml" />

<!-- switch keys -->
<key id="shift" switch="shift" />
<key id="numeric" switch="numeric" />
<key id="symbol" switch="symbol" />
<key id="base" switch="base" />
<key id="shift" layerId="shift" />
<key id="numeric" layerId="numeric" />
<key id="symbol" layerId="symbol" />
<key id="base" layerId="base" />

<!--
TODO: need discussion
Expand All @@ -52,40 +56,59 @@
-->
<key id="enter" gap="true" />


<!-- extra keys -->
<key id="u-grave" to="ü" />
<key id="e-grave" to="é" /> <!-- 2 -->
<key id="e-acute" to="è" /> <!-- 7 -->
<key id="c-cedilla" to="ç" /> <!-- 9 -->
<key id="a-acute" to="à" /> <!-- 0 -->
<key id="u-grave" output="ü" />
<key id="e-grave" output="é" /> <!-- 2 -->
<key id="e-acute" output="è" /> <!-- 7 -->
<key id="c-cedilla" output="ç" /> <!-- 9 -->
<key id="a-grave" output="à" />
<key id="a-acute" output="á" />
<key id="a-caret" output="â" />
<key id="a-umlaut" output="ä" />
<key id="a-tilde" output="ã" />
<key id="a-ring" output="å" />
<key id="a-caron" output="ā" />

<key id="A-grave" output="À" /> <!-- 0 -->
<key id="A-acute" output="Á" />
<key id="A-caret" output="Â" />
<key id="A-umlaut" output="Ä" />
<key id="A-tilde" output="Ã" />
<key id="A-ring" output="Å" />
<key id="A-caron" output="Ā" />


<!-- extra symbols -->
<key id="bullet" to="" />
<key id="umlaut" to="¨" />
<key id="super-2" to="²" longPress="" />

<!-- test key -->
<key id="a" flicks="a" to="a" longPress="à â á ä ã å ā" />
<!-- test key -->
<key id="A" flicks="b" to="A" longPress="À Á Ä Ã Å Ā" />
<!-- TODO: all additional maps, hardware and touch -->
<key id="bullet" output="" />
<key id="umlaut" output="¨" />
<key id="super-2" output="²" multiTapKeyIds="sub-2 2" /> <!-- taps produce: ² ₂ 2 -->
<key id="sub-2" output="" />

<!-- note that a-caret is the default-->
<key id="a" flickId="a" output="a"
longPressKeyIds="a-grave a-caret a-acute a-umlaut a-tilde a-ring a-caron"
longPressDefaultKeyId="a-caret" />
<!-- note that A-caret is the default-->
<key id="A" flickId="b" output="A"
longPressKeyIds="A-grave A-caret A-acute A-umlaut a-tilde A-ring A-caron"
longPressDefaultKeyId="A-caret" />
</keys>

<flicks>
<flick id="a">
<flickSegment directions="nw" to="\u{1234}" />
<flickSegment directions="nw se" to="\u{FFFF}" />
<flickSegment directions="e" to="\u{FFF0}" />
</flick>
<flick id="b">
<flickSegment directions="nw" to="\u{4567}" />
<flickSegment directions="nw se" to="\u{FFFF}" />
<flickSegment directions="e" to="\u{FFF0}" />
<flickSegment directions="nw" keyId="A-grave" />
<flickSegment directions="nw se" keyId="A-acute" />
<flickSegment directions="e" keyId="A-caron" />
<flickSegment directions="s" keyId="numeric" /> <!-- layer shifting flick-->
</flick>
<flick id="a">
<flickSegment directions="nw" keyId="a-grave" />
<flickSegment directions="nw se" keyId="a-acute" />
<flickSegment directions="e" keyId="a-caron" />
</flick>
</flicks>

<layers form="iso">
<layers formId="iso">
<!-- in DTD: required if conformsTo ≥ 41 -->
<layer modifier="none">
<row
Expand All @@ -105,7 +128,7 @@
</layer>
</layers>

<layers form="touch" minDeviceWidth="150">
<layers formId="touch" minDeviceWidth="150">
<!-- optional attribute for min physical device size -->
<layer id="base">
<row keys="a z e r t y u i o p" />
Expand Down
2 changes: 1 addition & 1 deletion keyboards/3.0/ja-Latn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<import base="cldr" path="techpreview/keys-Zyyy-currency.xml" />
</keys>

<layers form="jis">
<layers formId="jis">
<layer modifier="none">
<row keys="1 2 3 4 5 6 7 8 9 0 hyphen caret yen" />
<row keys="q w e r t y u i o p at open-square" />
Expand Down
40 changes: 20 additions & 20 deletions keyboards/3.0/mt-t-k0-47key.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,36 @@
<import base="cldr" path="techpreview/keys-Zyyy-currency.xml" />

<!-- accent grave -->
<key id="a-grave" to="à" />
<key id="A-grave" to="À" />
<key id="e-grave" to="è" />
<key id="E-grave" to="È" />
<key id="i-grave" to="ì" />
<key id="I-grave" to="Ì" />
<key id="o-grave" to="ò" />
<key id="O-grave" to="Ò" />
<key id="u-grave" to="ù" />
<key id="U-grave" to="Ù" />
<key id="a-grave" output="à" />
<key id="A-grave" output="À" />
<key id="e-grave" output="è" />
<key id="E-grave" output="È" />
<key id="i-grave" output="ì" />
<key id="I-grave" output="Ì" />
<key id="o-grave" output="ò" />
<key id="O-grave" output="Ò" />
<key id="u-grave" output="ù" />
<key id="U-grave" output="Ù" />

<!-- tikka and maqtugha -->
<key id="c-tikka" to="ċ" /> <!-- tikka is a dot -->
<key id="C-tikka" to="Ċ" />
<key id="g-tikka" to="ġ" />
<key id="G-tikka" to="Ġ" />
<key id="h-maqtugha" to="ħ" /> <!-- maqtugħa, i.e. cut -->
<key id="H-maqtugha" to="Ħ" /> <!-- maqtugħa, i.e. cut -->
<key id="z-tikka" to="ż" />
<key id="Z-tikka" to="Ż" />
<key id="c-tikka" output="ċ" /> <!-- tikka is a dot -->
<key id="C-tikka" output="Ċ" />
<key id="g-tikka" output="ġ" />
<key id="G-tikka" output="Ġ" />
<key id="h-maqtugha" output="ħ" /> <!-- maqtugħa, i.e. cut -->
<key id="H-maqtugha" output="Ħ" /> <!-- maqtugħa, i.e. cut -->
<key id="z-tikka" output="ż" />
<key id="Z-tikka" output="Ż" />

<!-- Cedilla -->
<key id="c-cedilla" to="ç" />
<key id="c-cedilla" output="ç" />

<!-- gaps -->
<key id="gap" gap="true" width="1" />
</keys>

<!-- 47-key: MSA 100:2002, Appendix, figure A.1 -->
<layers form="us">
<layers formId="us">
<layer modifier="none">
<row keys="c-tikka 1 2 3 4 5 6 7 8 9 0 hyphen equal" />
<row keys="q w e r t y u i o p g-tikka h-maqtugha z-tikka" />
Expand Down
40 changes: 20 additions & 20 deletions keyboards/3.0/mt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,33 @@
<import base="cldr" path="techpreview/keys-Zyyy-currency.xml"/>

<!-- accent grave -->
<key id="a-grave" to="à" />
<key id="A-grave" to="À" />
<key id="e-grave" to="è" />
<key id="E-grave" to="È" />
<key id="i-grave" to="ì" />
<key id="I-grave" to="Ì" />
<key id="o-grave" to="ò" />
<key id="O-grave" to="Ò" />
<key id="u-grave" to="ù" />
<key id="U-grave" to="Ù" />
<key id="a-grave" output="à" />
<key id="A-grave" output="À" />
<key id="e-grave" output="è" />
<key id="E-grave" output="È" />
<key id="i-grave" output="ì" />
<key id="I-grave" output="Ì" />
<key id="o-grave" output="ò" />
<key id="O-grave" output="Ò" />
<key id="u-grave" output="ù" />
<key id="U-grave" output="Ù" />

<!-- tikka and maqtugha -->
<key id="c-tikka" to="ċ" /> <!-- tikka is a dot -->
<key id="C-tikka" to="Ċ" />
<key id="g-tikka" to="ġ" />
<key id="G-tikka" to="Ġ" />
<key id="h-maqtugha" to="ħ" /> <!-- maqtugħa, i.e. cut -->
<key id="H-maqtugha" to="Ħ" /> <!-- maqtugħa, i.e. cut -->
<key id="z-tikka" to="ż" />
<key id="Z-tikka" to="Ż" />
<key id="c-tikka" output="ċ" /> <!-- tikka is a dot -->
<key id="C-tikka" output="Ċ" />
<key id="g-tikka" output="ġ" />
<key id="G-tikka" output="Ġ" />
<key id="h-maqtugha" output="ħ" /> <!-- maqtugħa, i.e. cut -->
<key id="H-maqtugha" output="Ħ" /> <!-- maqtugħa, i.e. cut -->
<key id="z-tikka" output="ż" />
<key id="Z-tikka" output="Ż" />

<!-- Cedilla -->
<key id="c-cedilla" to="ç" />
<key id="c-cedilla" output="ç" />
</keys>

<!-- 48-key -->
<layers form="iso">
<layers formId="iso">
<layer modifier="none">
<row keys="c-tikka 1 2 3 4 5 6 7 8 9 0 hyphen equal" />
<row keys="q w e r t y u i o p g-tikka h-maqtugha" />
Expand Down
18 changes: 9 additions & 9 deletions keyboards/3.0/pcm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
<keys>
<import base="cldr" path="techpreview/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="techpreview/keys-Zyyy-currency.xml" />
<key id="grave" to="\u{300}" />
<key id="backquote" to="`" />
<key id="acute" to="\u{301}" />
<key id="grave" output="\u{300}" />
<key id="backquote" output="`" />
<key id="acute" output="\u{301}" />

<!-- accented vowels -->
<key id="odot" to="" />
<key id="Odot" to="" />
<key id="edot" to="" />
<key id="Edot" to="" />
<key id="odot" output="" />
<key id="Odot" output="" />
<key id="edot" output="" />
<key id="Edot" output="" />

<!-- currency -->
<key id="naira" to="" />
<key id="naira" output="" />
</keys>

<layers form="iso">
<layers formId="iso">
<layer modifier="none">
<row keys="grave 1 2 3 4 5 6 7 8 9 0 hyphen equal" />
<row keys="acute w e r t y u i o p open-square close-square" />
Expand Down
36 changes: 18 additions & 18 deletions keyboards/3.0/pt-t-k0-abnt2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,34 @@
<version number="0.0.0" />
<info name="Portuguese (Brazil) (ABNT2)" />
<displays>
<display to="\m{acute}" display="´"/>
<display to="\m{grave}" display="`"/>
<display to="\m{umlaut}" display="¨"/>
<display to="\m{caret}" display="^"/>
<display to="\m{tilde}" display="~"/>
<display output="\m{acute}" display="´"/>
<display output="\m{grave}" display="`"/>
<display output="\m{umlaut}" display="¨"/>
<display output="\m{caret}" display="^"/>
<display output="\m{tilde}" display="~"/>
</displays>

<keys>
<import base="cldr" path="techpreview/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="techpreview/keys-Zyyy-currency.xml" />

<!-- TODO: using the proposed deadkey format -->
<key id="d-acute" to="\m{acute}"/>
<key id="d-grave" to="\m{grave}"/>
<key id="d-umlaut" to="\m{umlaut}"/>
<key id="d-caret" to="\m{caret}"/>
<key id="d-tilde" to="\m{tilde}"/>
<key id="d-acute" output="\m{acute}"/>
<key id="d-grave" output="\m{grave}"/>
<key id="d-umlaut" output="\m{umlaut}"/>
<key id="d-caret" output="\m{caret}"/>
<key id="d-tilde" output="\m{tilde}"/>

<key id="c-cedilla" to="ç" />
<key id="C-cedilla" to="Ç" />
<key id="c-cedilla" output="ç" />
<key id="C-cedilla" output="Ç" />

<key id="super-1" to="¹" />
<key id="super-2" to="²" />
<key id="super-3" to="³" />
<key id="ordinal-feminine" to="ª" />
<key id="ordinal-masculine" to="º" />
<key id="super-1" output="¹" />
<key id="super-2" output="²" />
<key id="super-3" output="³" />
<key id="ordinal-feminine" output="ª" />
<key id="ordinal-masculine" output="º" />
</keys>
<layers form="abnt2">
<layers formId="abnt2">
<layer modifier="none">
<row keys="apos 1 2 3 4 5 6 7 8 9 0 hyphen equal" />
<row keys="q w e r t y u i o p d-acute open-square" />
Expand Down
Loading

0 comments on commit 5f1d298

Please sign in to comment.