Loading...
 

KDT15 session 6

Keyman Developer Tutorial

Adding a Touch Keyboard

Session 6

This session we will modify a desktop keyboard for the Dagbani language of Ghana to add a touch keyboard for Dagbani.

1. Start Keyman Developer.

2. In the Project menu, point to Recent Projects, click DagbaniTutorial.kpj.

3. In the Project - Keyboard dialog box, click Keyboards. Then click dagbanitutorial.kmn.   The Details pagee appears.

4. Click Touch Layout. The Touch Layout page appears.  There is a Design tab and a Code tab.  The Code tab shows us the code that Keyman compiles to build the keyboard.  The Design tab shows a pictorial picture of the keyboard.  We will be using the Design tab. Click Design tab.

At the top of the Touch Layout pane, in the Platform dropdown, we can select phone or tablet. These are represented by iPhone and iPad graphical representations, but they will work on Android as well. We have the flexibility to have a different number of rows or columns of keys on the tablet and phone layouts, and so Keyman keeps them separate. If we want the exact same key structure on both, then select one of the two from the Platform dropdown. It is a lot of extra work to maintain two identical layouts. Keyman will automatically use the tablet if phone is not present or the phone if tablet is not present. Only if we want to make the tablet and phone layouts different, would we want to have both.  In our case, we want select phone only.  So, click on the adjacent Add and select phone in the Platform dropdown.  Then click OK. Now select tablet in the Platform dropdown and select the adjacent Del buttons to remove tablet from the dropdown list. We should only have phone on the dropdown list.

Note that another option for generating a tablet keyboard is to import the desktop keyboard by clicking Import from On Screen since the tablet platform has as many keys as we have on the desktop platform.  Doing this would mean that the tablet keyboard would have the same keystrokes as the desktop keyboard to generate the special characters.

Our touch keyboard will have three layers: default, shift and numeric.  We will initially work with the default layout. So, to indicate what layer we are on, set the Layer dropdown to default.

 

The Touch layout tab has a Character Map pane that we will be using to enter special keys onto the touch keyboard.  On the bottom of the pane, there is a Search box for a short description of the Unicode character that we are looking for (e.g. open e). The search box acts a filter of all the Unicode characters. So, by entering open e in the search box will display only those characters that have open e in their description.  When we find the desired character in the list, we click on it to select it.  It will be highlighted.  Note that above the Search box will be a full Unicode description of the selected key. To copy the special character to a key, select the key and then double-click it.

 

On the Touch layout page, we can start handling the additional characters. Remembering that all special characters on a touch keyboard must be visible somewhere, there are at least four options to add them to an existing keyboard. In the case of adding an open o to a Latin keyboard we could:

  • Placed the open o on an unused key, like x.
  • Placed the open o on a long-press popup so that long-pressing o gives the option to select it,
  • Place the open o on a different layer that appears when the activating key is pressed. Keyman has some different layer names (based on keyboard modifiers) that are predefined, plus a numeric layer, but custom layer names can be added.
  • Add a dedicate open o key to our keyboard.

​​​​​​​5. So, let's look at the first case.  We will replace the x key with open o.  Click on the x key and delete the x. In the character map, search for open o. Click on the open o (U+0254). Then double-click it.  Then in the Code box, enter U_0254.

We will replace the q key with open e.  Click on the q key and delete the q. In the character map, search for open e. Click on the open e (U+025B). Then double-click it.  Then in the Code box, enter U_025B.

Now save our work by clicking on the Save icon.

​​​​​​​6. So,let’s look at the second case.  We will add a long-press on o key for the open o. Click on the o key. Then click Add longpress popup.  In the Character Map, search for open o. Click on the open o (U+0254). Then double-click it. Then in the Code box, enter U_0254.

 

We will add a long-press on the e key for the open e. Click on the e key. Then click Add longpress popup.  In the Character Map, search for open e. Click on the open o (U+025B). Then double-click it. Then in the Code box, enter U_025B.

If we need to add another character to the long-press popup.  Depending on where we want it to be on the popup list, click one of the two plus in a green triangle icon and enter the current long-press character. To delete a character from the long-press popup, select the appropriate popup key and click the x in a red circle icon.

 

Now save our work, by clicking on the Save icon.

 

​​​​​​​7. So, let’s look at the third case.  We could add the open o to the numeric layer so that tapping numeric keythen vertical bar key will produce the open o. First, we will change the Layer box to display numeric, by clicking the down arrow of the Layer box and selecting numeric.  Click on the vertical bar key.  In the Character Map, search for open o. Click on the open o (U+0254). Then double-click it. Then in the Code box, enter U_0254.

Now save our work, by clicking on the Save icon.

 

​​​​​​​8. Now let's look at the fourth case.  A touch keyboard has the advantage over physical keyboards in that we can add and delete keys from the keyboard. We will add a new key for open o between the space bar and Enter key.  First, change the Layer box to default. Select the space bar. Click on the right plus in the green triangle icon. A new key has been created between the space bar and Enter key.  Now we are ready to define it.  Click on the new key.  In the Character Map, search for open o. Click on the open o (U+0254). Then double-click it. Then in the Code box, enter U_0254.

We can shorten the space bar so that row of the new key could go back to its original length by shortening the length of the space bar.  Click on the space bar and in the Width, box change 610 to 550.

Now save our work, by clicking on the Save icon.

 

​​​​​​​9. Now that we have looked at the four options for adding special characters to the keyboard, we use the long-press for building our Dagbani keyboard. We have already added the open e as a long-press of the e key.  We can tell a key has long-press key(s) by noting the diagonal line in the upper right corner of the key. We already added the open o as a long-press of the o key.  So now we need to the other three keys (eng, gamma & ezh) to the default layer of the keyboard.  First, verify the Layer box is set to default.

To add the eng character as a long-press on the n key, click on the n key. Then click Add longpress popup.  In the Character Map, search for eng. Click on the eng (U+014B) character to select it. Then double-click it. Then in the Code box, enter U_014B.

To add the gamma character as a long-press on the g key, click on the g key. Then click Add longpress popup.  In the Character Map, search for gamma. Click on the gamma (U+0263) character to select it. Then double-click it. Then in the Code box, enter U_0263.

To add the ezh character as a long-press on the z key, click on the z key. Then click Add longpress popup.  In the Character Map, search for ezh. Click on the ezh (U+0292) character to select it. Then double-click it. Then in the Code box, enter U_0292.

Now save our work, by clicking on the Save icon.

​​​​​​​10. Next, we want to add the capital letters for the five keys to our touch keyboard. First, we need to set the Layer box to shift.

To add the capitol open e character as a long-press on the E key, click on the E key. Then click Add longpress popup.  In the Character Map, search for open e. Click on the capitol open e (U+0190) character to select it. Then double-click it. Then in the Code box, enter U_0190.

To add the capitol open o character as a long-press on the O key, click on the O key. Then click Add longpress popup.  In the Character Map, search for open o. Click on the capitol open o (U+0186) character to select it. Then double-click it. Then in the Code box, enter U_0186.

To add the capitol eng character as a long-press on the N key, click on the N key. Then click Add longpress popup.  In the Character Map, search for eng. Click on the capitol eng (U+014A) character to select it. Then double-click it. Then in the Code box, enter U_014A.

To add the gamma character as a long-press on the G key, click on the G key. Then click Add longpress popup.  In the Character Map, search for gamma. Click on the capitol gamma (U+0194) character to select it. Then double-click it. Then in the Code box, enter U_0194.

To add the capitol ezh character as a long-press on the Z key, click on the Z key. Then click Add longpress popup.  In the Character Map, search for ezh. Click on the capitol ezh (U+01B7) character to select it. Then double-click it. Then in the Code box, enter U_01B7.

Now save our work, by clicking on the Save icon.

 

We have completed the touch keyboard for the Dagbani language.

Note that we would not usually add multiple ways for entering a special character like we with the open o character.  This was done for demonstrating different ways for adding special characters to a touch keyboard.

 

 


Contributors to this page: kent_schroeder .
Page last modified on Thursday April 21, 2022 18:39:24 GMT-0000 by kent_schroeder.

License

Creative Commons License
All content on this LingTranSoft wiki are by SIL International are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.