Skip to content

Commit

Permalink
CLDR-17113 kbd: add longPressDefaultKeyId
Browse files Browse the repository at this point in the history
- replaces longPressDefault=true
  • Loading branch information
srl295 committed Oct 10, 2023
1 parent a0ee437 commit 2ddc18a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
17 changes: 8 additions & 9 deletions docs/ldml/tr35-keyboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ This element defines a mapping between an abstract key and its output. This elem
flickId="{flick identifier}"
gap="true"
longPressKeyIds="{long press list id}"
longPressDefault="true"
longPressDefaultKeyId="{default longpress key}"
multiTapKeyIds="{multi tap list id}"
stretch="true"
layerId="{switch layer id}"
Expand Down Expand Up @@ -660,11 +660,11 @@ _Attribute:_ `gap="true"` (optional)
<key id="mediumgap" gap="true" width="1.5"/>
```

_Attribute:_ `longPressKeyIds="a b c"` (optional)
_Attribute:_ `longPressKeyIds="{list of key ids}"` (optional)

> A space-separated ordered list of `key` element ids, which keys which can be emitted by "long-pressing" this key. This feature is prominent in mobile devices.
>
> In a list of keys specified by `longPressKeyIds`, the key with the `longPressDefault="true"` attribute specifies the default long-press target, which could be different than the first element. It is an error to specify more than one key which has `longPressDefault="true"`.
> In a list of keys specified by `longPressKeyIds`, the key matching `longPressDefaultKeyId` attribute (if present) specifies the default long-press target, which could be different than the first element. It is an error if the `longPressDefaultKeyId` key is not in the `longPressKeyIds` list.
>
> For example, if the default key is a key whose [display](#Element_displays) value is `{`, an implementation might render the key as follows:
>
Expand All @@ -680,22 +680,21 @@ _Attribute:_ `longPressKeyIds="a b c"` (optional)
> </displays>
>
> <keys>
> <key id="o" output="o" longPressKeyIds="o-acute marker">
> <key id="o" output="o" longPressKeyIds="o-acute marker" longPressDefaultKeyId="marker">
> <key id="o-acute" output="ó"/>
> <key id="marker" longPressDefault="true" display="{"/>
> <key id="marker" display="{"/>
> </key>
>
> ```
_Attribute:_ `longPressDefault="true"` (optional)
> Specifies the default key in a list of long-press keys. See the discussion of `LongPressKeyIds`, above. If present, this attribute must have the value `"true"`.
_Attribute:_ `longPressDefaultKeyId="{key-id}"` (optional)
> Specifies the default key, by id, in a list of long-press keys. See the discussion of `LongPressKeyIds`, above.
_Attribute:_ `multiTapKeyIds` (optional)
> A space-separated ordered list of `key` element ids, which keys, where each successive key in the list is produced by the corresponding number of quick taps.
> It is an error for a key to referene itself in the `multiTapKeyIds` list.
> It is an error for a key to reference itself in the `multiTapKeyIds` list.
>
> _Example:_
> - first tap on the key will produce “a”
Expand Down
12 changes: 8 additions & 4 deletions keyboards/3.0/fr-t-k0-azerty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@
<key id="c-cedilla" output="ç" /> <!-- 9 -->
<key id="a-grave" output="à" />
<key id="a-acute" output="á" />
<key id="a-caret" output="â" longPressDefault="true" />
<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="Â" longPressDefault="true" />
<key id="A-caret" output="Â" />
<key id="A-umlaut" output="Ä" />
<key id="A-tilde" output="Ã" />
<key id="A-ring" output="Å" />
Expand All @@ -85,9 +85,13 @@
<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" />
<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" />
<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>
Expand Down
3 changes: 2 additions & 1 deletion keyboards/dtd/ldmlKeyboard3.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ Please view the subcommittee page for the most recent information.
<!ATTLIST key longPressKeyIds NMTOKENS #IMPLIED >
<!--@MATCH:any-->
<!--@VALUE-->
<!ATTLIST key longPressDefault (true) #IMPLIED >
<!ATTLIST key longPressDefaultKeyId NMTOKEN #IMPLIED >
<!--@MATCH:any-->
<!--@VALUE-->
<!ATTLIST key multiTapKeyIds NMTOKENS #IMPLIED >
<!--@MATCH:any-->
Expand Down
9 changes: 2 additions & 7 deletions keyboards/dtd/ldmlKeyboard3.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,7 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file
</xs:attribute>
<xs:attribute name="output"/>
<xs:attribute name="longPressKeyIds" type="xs:NMTOKENS"/>
<xs:attribute name="longPressDefault">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="true"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="longPressDefaultKeyId" type="xs:NMTOKEN"/>
<xs:attribute name="multiTapKeyIds" type="xs:NMTOKENS"/>
<xs:attribute name="stretch">
<xs:simpleType>
Expand Down Expand Up @@ -229,6 +223,7 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file




<xs:element name="flicks">
<xs:complexType>
<xs:sequence>
Expand Down

0 comments on commit 2ddc18a

Please sign in to comment.