Skip to content

Commit

Permalink
CLDR-17141 kbd: keep transform=no but document it (#3332)
Browse files Browse the repository at this point in the history
* CLDR-17141 kbd: keep transform=no but document it

* CLDR-17141 kbd: keep transform=no but document it

- don't name the special marker
  • Loading branch information
srl295 authored Oct 11, 2023
1 parent 00b938b commit 0ebdc9e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 18 additions & 2 deletions docs/ldml/tr35-keyboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ This element defines a mapping between an abstract key and its output. This elem
stretch="true"
layerId="{switch layer id}"
output="{the output}"
transform="no"
width="{key width}"
/>
```
Expand Down Expand Up @@ -739,6 +740,19 @@ _Attribute:_ `output`
>
> The `output` attribute may also contain the `\m{…}` syntax to insert a marker. See the definition of [markers](#markers).
_Attribute:_ `transform="no"`
> The `transform` attribute is used to define a key that does not participate in a transform.
> Using this attribute causes a marker to be added after the key’s output.
> In other words, the following produce the same results, except that the `\m{no_transform}` marker can be used by other parts of the keyboard in the second case.
> ```xml
> <key id="caret" output="^" transform="no" />
> <key id="caret" output="^\m{no_transform}" />
> ```
>
> See [Using markers to inhibit other transforms](#using-markers-to-inhibit-other-transforms) for more details about this approach.
_Attribute:_ `width="1.2"` (optional, default "1.0")
> The `width` attribute indicates that this key has a different width than other keys, by the specified number of key widths.
Expand Down Expand Up @@ -1661,7 +1675,7 @@ Consider the following abbreviated example:
-
- character `ê`

**Using markers to inhibit other transforms**
##### Using markers to inhibit other transforms

Sometimes it is desirable to prevent transforms from having an effect.
Perhaps two different keys output the same characters, with different key or modifier combinations, but only one of them is intended to participate in a transform.
Expand Down Expand Up @@ -1694,7 +1708,9 @@ One strategy would be to use a marker, which won’t be visible in the output, b
</transforms>
```

Pressing `caret` `e` will result in `^e` (with an invisible _no_transform_ marker — note that any name could be used). The `^e` won’t have the transform applied, at least while the marker’s context remains valid.
Pressing `caret` `e` will result in `^e` (with an invisible _no_transform_ marker). The `^e` won’t have the transform applied, at least while the marker’s context remains valid.

As a convenience, the above will behave identically to: `<key id="caret" output="^" transform="no">` (except that the marker used isn't otherwise usable)

Another strategy might be to use a marker to indicate where transforms are desired, instead of where they aren't desired.

Expand Down
2 changes: 2 additions & 0 deletions keyboards/dtd/ldmlKeyboard3.dtd
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ Please view the subcommittee page for the most recent information.
<!ATTLIST key layerId NMTOKEN #IMPLIED >
<!--@MATCH:any-->
<!--@VALUE-->
<!ATTLIST key transform (no) #IMPLIED >
<!--@VALUE-->
<!ATTLIST key width CDATA #IMPLIED >
<!--@MATCH:range/0.01~100.0-->
<!--@VALUE-->
Expand Down

0 comments on commit 0ebdc9e

Please sign in to comment.