Error while creating new layer in touch layout GUI view

I am new to keyman and currently using Keyman Developer for Windows version 13.0.105.0

I am trying to design a custom keyboard for android, and I will be using the Keyman android library

In the Layer drop down menu I deleted numeric and shift,

km_forum_q_20200427
and I thought I could just make new custom layer names, but whenever I try making a new layer such as layer1 and press ok, the screen goes blank, and the mobile design GUI view only comes back once I click the code view tab at the bottom and click design view again. If I check the drop down menu again, I only see the default layer and no other layer is created. There are no error messages either. If I choose one of the built in layer names (numeric, shift) then it works.

Is this how it is supposed to work? Can I only make a few specified layers? Then what is the custom layer option?

Hi @mahaju, welcome to the community!

It sounds like something is not right in adding layers. You should be able to create custom layers. I can’t seem to reproduce the problem here, so if you could try the following:

  1. In the touch layout editor, press F12 to open the Developer Console.
  2. Try adding the new custom layer again.
  3. In the Developer Console, you should see a Console tab. Click this and copy any red error messages you see there, and paste them into a response here :slight_smile:

hi thanks for the reply
This is what I see in console tab of the developer window (this console text appears after I press the code tab and then the Design tab, after the screen goes blank when trying to create a custom layer “layer1”

Each of these lines can be expanded by clicking on the triangle at the left. Here are the 4 messages and the expanded text from the first one:

https://pastebin.com/Hty98cu9

Meanwhile I seem to have found a workaround. If I create a normal layer (shift), then go to code view and just change it’s name there ( “id”: “shift”, => “id”: “shift2”,) and come back to the GUI view, the layer name changes to “shift2” in the drop down menu and then I can create another “shift” layer. Is this a good way to do this? I did something like this for a custom layer

  {
    "id": "shift2",
    "row": [
      {
        "id": 1,
        "key": [
          {
            "id": "T_A1",
            "text": "a1"
          },
          {
            "id": "T_A11",
            "text": "a11"
          }
        ]
      },
      {
        "id": 2,
        "key": [
          {
            "id": "T_A2",
            "text": "a2"
          }
        ]
      },
      {
        "id": 3,
        "key": [
          {
            "id": "T_A3",
            "text": "a3"
          }
        ]
      }
    ]
  },  

where the name shift2 was manually changed from “shift”. The button

        "id": "T_A1",
        "text": "a1"  

does not have the same width and height as the corresponding button from the default layer. When I create button from the code view, the button size seems to become messed up, while doing it from the GUI works correctly.

Keeping this in mind, can I use the workaround I mentioned above to make my custom layers? That is,
make a normal shift layer and then and change it’s name in the code view.

Here what the buttons on my shift2 layer look like:

Here’s similar buttons on the default layer:

|| new user limited to one picture per post, but the default layer buttons have the same size as the default english keyboard in kayman ||

The log you posted shows no significant errors. That’s helpful – I guess! It rules out one line of inquiry.

Yes, that’s a good workaround.

Regarding the size of keys on your keyboard – each layer is sized independently. You’ll need the same number of rows as your base layer, and the total width (as shown on the right hand side of the window “2 keys, 200 key width, 30 padding, 230 total”) is then factored out among the keys. This allows for good cross-platform portability of the keyboard, with different sized devices allowing for keys growing and shrinking to fit the space neatly.

You can add ‘blank’ or ‘spacer’ keys to adjust the relative widths of keys. The aim is to get the total width of the widest row on your second layer to match the total width of the base layer’s widest row.

So the important thing is to have the same number of rows in all the layers?
Thanks for your help
I’ll update my keyboard with the workaround method and ask another question if there are any problems

Yes – that makes the layers have consistent key heights.