Why is my layout not compiling for Web or Mobile?

I made a keyboard layout on Keyman. I don’t think I’ve done anything weird, but it won’t compile for Web or Mobile. What did I do wrong, and how do I fix it?

I downloaded your files and loaded the .kmn file into Keyman Developer. When I tried to compile, the desktop layout compiled, but (as you noted) the mobile layout did not. In the Messages pane, there are multiple messages like:

shaw_2layer.kmn: Warning: 2092 Key "T_new_2244" on layer "default", platform "tablet", is a custom key but has no corresponding rule in the source.

In Developer, you can use Project menu, Project Settings menu item, then untick the box labeled “Treat compiler hints and warnings as errors”. Then the mobile layout should compile. You will, of course, need to deal with these warnings!

Looking at that first warning, T_new_2244 is a longpress key, showing a comma. If you change the ID for that key from T_new_2244 to U_002C, that key will produce the comma (U+002C) directly without needing a link to the .kmn file (which then would need a rule to produce a comma when it receives the [T_new_2244] key). Using the U_xxxx format for the ID whenever possible will simplify your keyboard.

If this doesn’t answer your question, please write again!

1 Like

Wow, I never knew that the automatic key name that Keyman Developer autofilled was invalid.

So, when you add a key to the touch layout, Keyman Developer does not assign behaviour to that key automatically. Remember that what is shown on the key cap may not be identical to what the key actually emits (for example, for characters such as diacritics, control characters, spacing, and this is particularly important for South-East Asian and South Asian writing systems).

It is up to you to define the behaviour by adding a rule to the keyboard (e.g. + [T_new_2244] > ',') or by setting the ID for the key to a shorthand Unicode value form as described by @drowe, which has an inherent behaviour.

You can learn more about the different inherent behaviours that various key ID types have at Creating a Touch Keyboard Layout Part 2