Delete a decomposed pair

I’m creating a keyboard based on Latin but with some combining diacritics.

Currently if we have c̣ (U+0063 U+0323) it takes two keystrokes to delete the character. The users would prefer it to just take one.

Can this be done? (within Keyman, I understand the underlying data has two characters and a regular keyboard will always take two strokes)

I think something like this would work:
U+0063 U+0323 + [K_BKSP] > ""
or possibly
U+0063 U+0323 + [K_BKSP] > nul

You could even uses a class:
any(consonant) U+0323 + [K_BKSP] > nul
or
any(consonant) any(dia) + [K_BKSP] > nul

Yes, using > nul is the right approach.

Note that while editing, in some apps users may find that they still have to backspace twice. In modern apps, Keyman can edit the app’s text directly, but in some legacy apps, Keyman has to simulate this, which means when the user moves the cursor, Keyman no longer knows what is there and so these rules will no longer match.

Thank you. That worked great.

It’s so obvious once you know the answer :slight_smile:

1 Like

Yeah, just note that it doesn’t work if you copy paste the characters in. Just if you recently typed them yourself. I don’t think there’s a better fix though.

@Gdmqx, Keyman won’t change existing content unless you are editing it, and then, where it can, it will fixup content as you edit: some apps do not make it possible for Keyman to see existing content and modify it directly (which means that Keyman can delete text with backspace but not otherwise update it), but many modern apps do.