I’m just wondering, are you working with the raw JSON format .keyman-touch-layout instead of using the visual editor? The visual touch layout editor included with Keyman Developer makes it much easier to work with the files.
In terms of the touch layout files, there’s a fundamental concept here that I think is important to understand: the .keyman-touch-layout file describes the position of keys on a touch layout. It is not really about their behaviour.
Each key in a touch layout has an identifier that:
- maps to a hardware key on a physical keyboard (e.g.
K_A
), or
- maps to a Unicode value (e.g.
U_1234
), or
- is a custom touch layout identifier (e.g.
T_A_ACUTE
).
Each key you press on the touch layout will generate an event for the .kmn keyboard rules, so you can map K_A
, T_A_ACUTE
, or even U_1234
from the touch layout to a corresponding rule in the Keyman source file. So, given a .keyman-touch-layout snippet such as:
...
"row": [
{
"id": 1,
"key": [
{ "id": "K_A", "text": "a" },
{ "id": "T_A_ACUTE", "text": "á" },
{ "id": "U_1234", "text": "\u1234" },
...
]
},
...
You could have a set of corresponding rules in the .kmn file for transforming the output:
+ [K_A] > 'a'
+ [T_A_ACUTE] > 'á'
+ [U_1234] > U+2468 c possible, but not advisable, for illustration only!
These rules must be in the .kmn file, which then can share behaviour between desktop and touch layouts.
This means that all the flexibility of what you can achieve on the desktop with Keyman rules is equally available on touch devices. This includes working with context or multiple groups.
Note that some key identifiers do inherit “default” output if you don’t define rules for them. That includes the K_xxx
identifiers – which emit the corresponding character if one exists, and any U_xxxx
Unicode identifiers. T_xxxx
identifiers never have any default behaviour.
More info: