From f7efe778c19e317e2aae16c7ada16d09322f9be0 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Mon, 9 Oct 2023 16:51:41 -0500 Subject: [PATCH] CLDR-17141 kbd: drop transform=no - expand documentation about use of markers to inhibit transforms --- docs/ldml/tr35-keyboards.md | 112 +++++++++++++++----------------- keyboards/dtd/ldmlKeyboard3.dtd | 2 - keyboards/dtd/ldmlKeyboard3.xsd | 8 --- 3 files changed, 52 insertions(+), 70 deletions(-) diff --git a/docs/ldml/tr35-keyboards.md b/docs/ldml/tr35-keyboards.md index 0205e254202..d4cd7a0e489 100644 --- a/docs/ldml/tr35-keyboards.md +++ b/docs/ldml/tr35-keyboards.md @@ -623,7 +623,6 @@ 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}" /> ``` @@ -736,65 +735,6 @@ _Attribute:_ `output` > > The `output` attribute may also contain the `\m{…}` syntax to insert a marker. See the definition of [markers](#markers). -_Attribute:_ `transform="no"` (optional) - -> The `transform` attribute is used to define a key that does not participate in a transform (until the next keystroke). This attribute value must be `"no"` if the attribute is present. -> This attribute is useful where it is desired to output where two different keys could output the same characters (with different key or modifier combinations) but only one of them is intended to participate in a transform. -> When the next keystroke is pressed, the prior output may then combine using other transforms. -> -> Note that a more flexible way of solving this problem may be to use special markers which would inhibit matching. -> -> For example, suppose there are the following keys, their output and one transform: - -```xml - - - - -… - - - -``` - -* **X** outputs `^` (caret) -* Option-**X** outputs `^` but is intended to be the first part of a transform. -* Option-**X** + `e` → `ê` - -> Without the `transform="no"` on the base key **X**, it would not be possible to -> type the sequence `^e` (caret+e) as it would turn into `ê` per the transform. -> However, since there is `transform="no`" on **X**, if the user types **X** + `e` the sequence remains `^e`. - -* **X** + `e` → `^e` - -> Using markers, the same results can be obtained without need of `transform="no"` using: - -```xml - - - - -… - - - - -``` - -Even better is to use a marker to indicate where transforms are desired: - -```xml - - - - -… - - - - -``` - _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. @@ -1766,6 +1706,58 @@ Consider the following abbreviated example: - … - character `ê` +**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. + +Consider the following case, where pressing the keys `X`, `e` results in `^e`, which is transformed into `ê`. + +```xml + + + + + + + +``` + +However, what if the user wanted to produce `^e` without the transform taking effect? +One strategy would be to use a marker, which won’t be visible in the output, but will inhibit the transform. + +```xml + + + + + +… + + + + +``` + +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. + +Another strategy might be to use a marker to indicate where transforms are desired, instead of where they aren't desired. + +```xml + + + + + +… + + + + +``` + +In this way, only the `X`, `e` keys will produce `^e` with a _transform_ marker (again, any name could be used) which will cause the transform to be applied. One benefit is that clicking or using the arrow key to navigate existing text with `^e` will never be affected by the transform, because the marker is not or no longer present. + **Effect of markers on final text** All markers must be removed before text is returned to the application from the input context. diff --git a/keyboards/dtd/ldmlKeyboard3.dtd b/keyboards/dtd/ldmlKeyboard3.dtd index 07ee8edf1d4..d8d1087420d 100644 --- a/keyboards/dtd/ldmlKeyboard3.dtd +++ b/keyboards/dtd/ldmlKeyboard3.dtd @@ -115,8 +115,6 @@ Please view the subcommittee page for the most recent information. - - diff --git a/keyboards/dtd/ldmlKeyboard3.xsd b/keyboards/dtd/ldmlKeyboard3.xsd index 07b03282db3..d4c5b1754fb 100644 --- a/keyboards/dtd/ldmlKeyboard3.xsd +++ b/keyboards/dtd/ldmlKeyboard3.xsd @@ -195,13 +195,6 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file - - - - - - - @@ -221,7 +214,6 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file -