Designing the layout for my first custom keyboard.
Introduction
In this article I will walk you through the design of the button layout for my first custom keyboard. I built my first custom keyboard because there was no stock keyboard with a layout that completely suited my personal needs and requirements. Designing the custom layout is the first step of building a new keyboard. Once I realized that not only can you choose the switches and keycaps of a keyboard, but you can also design a complete layout from scratch, this is where the fun starts! Fortunately, excellent tools for this process are available.
The website
The tool of choice for designing a layout is the website keyboard-layout-editor.com (or just “KLE” for those who know). The software behind the site is open source and can be found on GitHub. On the website you can visually design the layout and save it as a JSON file. This JSON file can later be used in other tools for the keyboard build.
For now, I will only focus on the top part of the site, where a graphic representation of the keyboard is displayed. However, if at any point you want to save your progress, click the “</> Raw Data” tab, and click “Download JSON” to save a file with the current layout definition. This file can be opened later on the same tab with the “Upload JSON” button.
Select a starting point
First, I select a default layout that is close to what I need, so don’t need to do a lot of edits. From the top menu, select “Preset” and select “Default 60%”.
The reason I use this as a starting point is my main constraint: I want to build cheap. I don’t know if I am going to end up with a working keyboard at all. The advantages of using “Default 60%” as a starting point:
- Cheap cases are abundantly available because this is a very common keyboard size for custom builds.
- I can use a standard sized keycap kit, which are also abundantly available.
Delete unwanted keys
I really want cursor keys on my keyboard, and hardly ever use the modifiers at the right bottom of a keyboard. So, let’s first make room for the arrow keys by deleting the unwanted keys.
First I select the keys to be deleted. A red outline is shown around selected keys.
- Click a key to select it
- Control-click other keys to add them to the selection.
Then I click the red “Delete keys” button at the top of the screen.
Add new keys
Add new keys with the “Add key” button at the top left. I click 5 times for 4 arrow keys and 1 “Fn” key. New blank keys are added at the bottom left of the layout. I select the new buttons and use the arrow keys on your keyboard to move them to the correct positions.
I select the blank key to the right of the spacebar and press Shift+Right once. This makes the key 0.25U wider. Dimensions of all keyboard keys are expressed in “U” units. The normal alphabet keys are 1U high and 1U wide. Larger keys are always larger in increments of 0.25U. For instance, a default spacebar is 6.75U wide and a default Tab key is 1.5U wide. The new key is now 1.25U wide, which is the size of the “Fn” key in most keycap kits.
Add labels and images
Now I add labels to the blank keys. I select the blank key to the right of the spacebar and open the “Properties” tab. Here are 4 rows of text boxes for labels: top, center, bottom and front. Each row has 3 text boxes for left, center and right. Since the existing labels are all top and left, I’ll go with that. I enter “Fn” in the leftmost textbox of the “Top legend” row.
To add arrow images to the arrow keys, I choose “Keyboard-Layout-Editor icons” from the “Character picker” menu. The icons are now shown to the right. To add an icon to a key, I drag the icon from the list of icons and drop it on the desired label text box.
My last modification is that I want a “Delete” button on my keyboard. No empty space left for an additional key, so I decided sacrifice the “]” key. My reasoning was that this key is not often used, since most text editors nowadays automatically add a closing bracket when an opening bracket is typed. This is not optimal as it turns out, but that is the thing with building keyboards: you’re never finished.
Finally, I increased the label font size and added some color to the keys. Colors are changed using the “Legend Color” and “Key Color” text boxes. Notice that these also work when multiple keys are selected. I went for the classic black, white and orange theme, and this is what I ended up with:
Remember to save the JSON file from the “Raw data” tab! This data is later used to generate a keyboard plate and the firmware configuration.
[{c:"#ea4221",t:"#ffffff",f:4},"Esc",{c:"#373738"},"!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=",{w:2},"Backspace"],
[{w:1.5},"Tab",{c:"#e4dedd",t:"#000000"},"Q","W","E","R","T","Y","U","I","O","P",{c:"#373738",t:"#ffffff"},"{\n[","Del",{w:1.5},"|\n\\"],
[{w:1.75},"Caps Lock",{c:"#e4dedd",t:"#000000"},"A","S","D","F","G","H","J","K","L",{c:"#373738",t:"#ffffff"},":\n;","\"\n'",{w:2.25},"Enter"],
[{w:2.25},"Shift",{c:"#e4dedd",t:"#000000"},"Z","X","C","V","B","N","M",{c:"#373738",t:"#ffffff"},"<\n,",">\n.","?\n/",{x:0.75,c:"#ea4221"},"<i class='kb kb-Arrows-Up'></i>"],
[{c:"#373738",w:1.25},"Ctrl",{w:1.25},"Win",{w:1.25},"Alt",{a:7,w:6.25},"",{a:4,w:1.25},"Fn",{x:0.75,c:"#ea4221"},"<i class='kb kb-Arrows-Left'></i>","<i class='kb kb-Arrows-Down'></i>","<i class='kb kb-Arrows-Right'></i>"]