Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sil_euro_latin] don't auto-switch to default layer when on numeric layer #3013

Open
ermshiperete opened this issue Aug 5, 2024 · 3 comments

Comments

@ermshiperete
Copy link
Contributor

In German the comma is used as decimal separator. When on the numeric layer and typing digits followed by a comma, the keyboard switches back to the default layer. If you type a period instead, it stays on the numeric layer.

Looking at the other keys on the numerical layer, they are all related to numbers and math, and so I think it would make more sense to disable automatic layer switching for the numeric layer. Typing any key on the numerical layer stays on the numerical layer. To go back to the default layer you press the layer button.

@ermshiperete ermshiperete changed the title bug/feat: Euro-Latin should stay on Numeric layer bug/feat: Euro-Latin: don't auto-switch to default layer when on numeric layer Aug 5, 2024
@ermshiperete ermshiperete changed the title bug/feat: Euro-Latin: don't auto-switch to default layer when on numeric layer [sil_euro_latin]: don't auto-switch to default layer when on numeric layer Aug 5, 2024
@ermshiperete ermshiperete changed the title [sil_euro_latin]: don't auto-switch to default layer when on numeric layer [sil_euro_latin] don't auto-switch to default layer when on numeric layer Aug 5, 2024
@mcdurdin
Copy link
Member

mcdurdin commented Dec 3, 2024

Looking at the other keys on the numerical layer, they are all related to numbers and math, and so I think it would make more sense to disable automatic layer switching for the numeric layer.

This is not accurate. There are many other punctuation symbols on the numeric layer, e.g. ". We need more nuance. See my comment on #3235 for further discussion.

@mcdurdin
Copy link
Member

mcdurdin commented Dec 4, 2024

Draft specification for numeric layer switch nuance

(from #3235)

TODO: go through each symbol on numeric layer to determine layer switching logic. Note that characters accessed through flicks will remain on default layer so that's good.

First, I would prefer that this be implemented in the .kmn rather than in the touch layout -- in the begin postkeystroke code path. The logic is there for digits already:

    c Okay, let's stay on the numeric layer if we are there already
    platform('touch') if(&newLayer = "") if(&layer = 'numeric') any(digit) > context

So we just need to create a new store digits-and-punct that includes the other outputs that should not switch layers, and use that there, I think.

Also, I don't think all the punctuation keys should be keeping us on the numeric layer, e.g. '"' should definitely go back to default. We need to consider each punctuation character carefully; the following are my starting thoughts:

0-9 -- stay numeric
. and , -- these should go back to the default layer unless preceded by a digit.
@ -- IMO go back to default layer, used most commonly probably in email addresses
# -- Debatable, the online elite use hashtags 😆
<, > -- Debatable again... can be used for maths but also many other things. perhaps if preceded by digits plus optional whitespace?
«, » -- these are quotation marks, so go back to default
+, -, *, /, ^, %, =, -- all of these have multiple uses (particularly - and /!). I don't think treating them as maths symbols only makes sense. If preceded by digits and optional whitespace?
( and friends -- these are much more commonly used in text than for numbers, I think. Should not stay in numeric layer
", !, `, ~, ¡, ?, ¿, ;, :, and & -- these are not numeric related. Go back to default layer.

We can add more nuance to the layer switch by sticking in the numeric layer when in the middle of a digit sequence and mathematical operators are used, but apart from that I think we need to drop back to default layer.

The rules would be something like (needs careful crafting):

    store(math-operator) ',.=+-*/' c ... and others
    store(spacing-math-operator) '=+-*/' c ... and others, but not ./,
    platform('touch') if(&newLayer = "") if(&layer = 'numeric') any(digit) any(math-operator) > context
    platform('touch') if(&newLayer = "") if(&layer = 'numeric') any(digit) ' ' any(spacing-math-operator) > context

Thought bubble: :-) (and friends) are common 'phrases' we might be able to support as well in this pattern.

Second thought: phone numbers in many parts of the world are space separated, while in some places they tend to be hyphen separated: e.g. 0412 345 678 is an Australian mobile number; (555) 123-4567 is a US style phone number. Is it worth trying to help out on these patterns -- or are there just too many of them?

@mcdurdin
Copy link
Member

mcdurdin commented Dec 4, 2024

Not addressed in #3235

@mcdurdin mcdurdin reopened this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants