Request For Comment: Specification for Start of text/sentence selects `shift` layer

We are opening this specification up for comment before we start implementation, currently scheduled to start on 19 October 2020.

Introduction

At the start of text, it would be helpful for the keyboard to select an appropriate layer. For the purposes of this discussion, this feature should only apply to a standard text control, and not be activated for email, numeric or other types of input controls.

For most Latin script languages, an appropriate layer for start of text is the shift layer. This is certainly not true for other scripts or for a subset of Latin script languages.

Similarly, at the start of a sentence, for most Latin script languages, the shift layer should be selected.

Continue reading on GitHub

The newContext entry point will be called whenever the user enters a new context, for example, by focusing an edit control, or by moving the insertion point, or tabbing to a new cell in a table.

So there would be some sort of check of that new context, right? e.g. If you click in the text after sentence-final punctuation and space, then it’s activated. But if you click in the middle of the word to edit it, even though you’ve moved the insertion point, the shift layer is not activated, right?

Yes, that’s the point of the following code:

group(selectNextLayer) readonly
  store(sentencePunctuation) '.?!'
  nul > layer(shift)
  any(sentencePunctuation) ' ' optany(' ') > layer(shift) 

If not at start of context (nul), or after, e.g. . , then no layer change would be performed. It’s up to the keyboard to define those rules of course.

On touch platforms, it is generally the case that we can read context when the insertion point is moved, so we won’t end up with a nul context in the middle of a word. There are more caveats for desktop platforms (but the layer code doesn’t apply here anyway – as we don’t support touch on desktop at this time, and we wouldn’t be applying this behaviour to the OSK).

Ah, that’s how that works! Great!

1 Like