Using "store" to achieve ´ + h > h́

Hello,

I am trying to use stores to achieve the letter h with an accent over it (h́ and H́). From what I can tell this only exists as a combined character, as opposed to a single unicode character such as ć or Ć.

This is what I had so far for my keyboard, which is based on the Latin American Keyboard, Source KeyboardID: 0000080a:

store(consonants_without_accent) U+0063 U+0043 U+0072 U+0052 U+0073 U+0053 c | c C r R s S
store(consonants_with_accent)    U+0107 U+0106 U+0155 U+0154 U+015B U+015A c | ć Ć ŕ Ŕ ś Ś
dk(00b4) any(consonants_without_accent) > index(consonants_with_accent, 2) 
c | use the "´" key to add the accent, just like the vowels. 

But it occurred to me that if I put U+0068 U+0048 in store(consonants_without_accent) but U+0068 U+0301 U+0048 U+0301 in store(consonants_with_accent), they will not be the same length. I tried typing U+0068_0301 and U+0068+0301 similar to touch layout syntax but Keyman Developer put 0301 in red, telling me that it didn’t like the syntax.

Is there a way for me to do this with stores? Or, do I need to do character substitution?

U+00B4 U+0068 > U+0068 U+0301
U+00B4 U+0048 > U+0048 U+0301

I tried looking around online for guidance but couldn’t find the right page.

Thanks for your help!

dk(00b4 + U+0068 > U+0068 U+0301
dk(00b4) + U+0048 > U+0048 U+0301

If those are the only two characters like that, I would recommend just adding those two rules. If there are more characters, you could add something like this:

store(decomp) "hHkKqQ"
dk(00b4) + any(decomp) > index(decomp,2) U+0301

That adds two lines also. So, it’s only helpful if you have more than 2 decomposed characters.

1 Like

Thanks so much! This is just what I needed. I ended up going with the second solution since it will be easier to expand on if need be.

I made some slight modifications and went with this:

store(decompuestos) U+0068 U+0048 c | h H
dk(00b4) any(decompuestos) > index(decompuestos,2) U+0301 c | h́ H́

Thanks again!

1 Like

Remember, if this is a “using keys” section of the keyboard you need the + sign to show the context and then the keystroke.

Just noting that the LDML Keyboard format supports this concept well. (But it is desktop-only in Keyman for v17, need to wait for v18 for the full excitement)

This topic was automatically closed after 7 days. New replies are no longer allowed.