Match rule not working

I am making a mobile keyboard with accent deadkeys. If one types the grave accent deadkey, it will type , and then if you type [a], then it will replace the with à. This works fine. However, I am trying to write some code so that if one types a consonant instead, you will get just the consonant, and the ` will be deleted.

To do this, I am trying to create a match rule in my main group, that will go to a new group with rules to replace any [cons] sequence with [cons] (or [cons][cons] with [cons][cons], etc., since I have some keys that output two or three consonants.)

However, I can’t seem to get either a match or a nomatch rule to do anything, even just ouputting test text or changing the layer.

File:

teclado_itunyoso_triqui.kmn (38.8 KB)

Statements in question are on lines 586-588

Thanks!

I haven’t examined your keyboard in depth, but it seems unnecessarily complex. Maybe these suggestions will help a bit although I haven’t looked at what all your keyboard is doing.
You could have two stores:

store(vowels) 'aeiouAEIOU'
store(acutes) 'áéíóúÁÉÍÓÚ'
store(graves) 'àèìòùÀÈÌÒÙ'

Then a rule that gives the deadkey:

 + [K_QUOTE] > deadkey(acute)
 + [K_BKQUOTE] > deadkey(grave)

Then rules for the acute and grave:

dk(acute) + any(vowels) > index(acutes,2)
dk(grave) + any(vowels) > index(graves,2)

Do that with the various accents.

Then, have a store and a rule to protect the consonants:

store(cons) "bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ"
dk(acute) + any(cons) > index(cons,2)
dk(grave) + any(cons) > index(cons,2)

I do notice your keyboard gives a lot of warning when I compiled in the Messages window.
The warnings and errors always give a line number where the issue is.

1 Like

Thank you for the help! I just realized I had been testing the wrong file, since I had renamed it. The match rules work fine. Apologies for the silly question.