Inputing digraphs in Touch Keyboard?

I’m making a desktop/mobile keyboard for a language that has numerous digraph letters. Having digraphs result on a keypress seems to compile without errors on the desktop keyboards, but doesn’t compile on the touch keyboards. For example, the touch key for “tlh” has “U_0074 U_006C U_0068” in the Code field, but compiling gives:
Error: 405A Key “U_0074 U_006C U_0068” on “tablet”, layer “default” has an invalid identifier.

Welcome to the community!

For “Code” you need it to not have spaces.
Call it something like: T_t_l_h or T_0074_006C_0068 whatever makes sense, but don’t include any spaces. The name doesn’t actually do anything for you until your write a rule for it…

Then in the .kmn file (the bottom of your code is a good place to put touch specific rules, add two rules:

[T_t_l_h] > U+0074 U+006C U+0068
[SHIFT T_t_l_h] > U+0054 U+004C U+0048

You will actually have to think through how you want the digraphs if you want the SHIFT ones to all be uppercase, or just the first be uppercase, etc.

1 Like

Thanks! I had tried “U_0074U_006CU_0068” in the code, but I will try this.

This seems to have worked in terms of actual text input, but when testing the mobile keyboard in the Google Chrome Developer Tools, the displayed mobile keyboard has the default key text instead of the correct key text on all of the keys. It looks like the default key text of a desktop keyboard instead of the mobile keyboard (this is a desktop & mobile project). For example, on the desktop the [x] key is mapped to produce the [tlh], and pressing it does produce [tlh] even though the key text is [x]. In the code tab, here’s the code for that key:
“id”: “T_t_l_h”,
“text”: “tlh”,
“sk”: [
“text”: “x”,
“id”: “U_0078”
It has a longpress option for [x] to switch back to English Latin text.

I assume that the Google Chrome Developer Tools test is just testing a mobile view of the desktop keyboard. I’m testing on Google Chrome because I can’t connect to the test web page on my mobile device for some reason.

My guess is that you have both a tablet and a mobile layout setup in the touch layout editor. Unless you plan for them to be different, you can select that layout in the toolbar at the top of the touch layout editor and remove it.

In terms of being able to access the web page on your mobile device, there are a few possible barriers:

  1. Your mobile device needs to be on the same network (e.g. Wifi) as your computer.
  2. You need to select the appropriate address from the list of addresses in Keyman Developer so that your mobile device can access it (for example, ‘localhost’ is only available to your computer).
  3. Your computer may have a firewall rule that is blocking Keyman Developer from sharing the test site with other devices.
  4. (this one is less likely) You may be on a Wifi network that has blocked connections between peers on the network.

I deleted the phone touch layout in the editor and it displayed as I had expected. I turned my firewall off for a few minutes and was able to connect. Found another couple problems with my touch layout in testing, so I’m back to editing it. Thanks!

1 Like

You should be able to add an exception for Keyman Developer (usually C:\Program Files (x86)\Keyman\Keyman Developer\tike.exe) in your firewall settings to allow it to always work.

Hi Lorna - I’m trying to to the same thing for long-press for di / trigraphs for initial, long and long initial vowels in Arabic script, based on the vowel positions on an AZERTY keyboard.
I’ve put in the T_… ids for each item in the long-press menu, but I’m stuck at this point - if I try and add these rules at the bottom of the KMN file I get ‘Invalid token’ errors in the compiler.
Do I need to add + for each one? If I do the compiler gives me an invalid JSON error. Sorry I’m not familiar with the syntax.

+ [K_Q] > 'َ'
+ [T_INIT_A] > U+0623 U+064E
+ [T_LONG_A] > U+064E U+0627
+ [T_INIT_LONG_A] > U+0638 U+064E U+0627
+ [T_INIT_E] > U+0625 U+065C


Ah, yes you do need a plus in front of each rule. I guess I’d need to see your kmn file to see why it’s giving you an error. These rules should be at the bottom of the “main” group. If you have other groups then they shouldn’t be at the bottom of the .kmn file, they should be at the bottom of the main group.
I see this keyboard has an example of this type of rule