Update: The source code for the keyboard can be found here:
https://github.com/jlidauer/DAKHi,
I have build a bit unusual keyboard and I thought you might be interested in this project, so here is how I build it.
IntroductionA double action keyboard is a keyboard that has switches with two physical positions (two steps), therefore it is possible that one key has two different functions. For example when a button is pressed only one step down the keyboard sends to the computer the key a and if the same button is pressed two steps down it sends a special character.
I got this idea when I was looking for a better keyboard (especially for programming). The Finnish keyboard layout that I use is rather sub-optimal for programming purposes, because many often needed special characters can be typed only using ALT + CTRL + number_key combinations, which is quite slow. The double action switch has pretty much the same idea as a double action button found on almost any digital camera trigger, where the first step is autofocus and the second step the shutter.
Construction of the double action switchWhen I started designing the keyboard my biggest challenge was to find switches with two states that are suitable for a keyboard, since I was not able to find any I had to build them myself. I came up with a design that uses normal Cherry MX switches with some modifications. The idea is to solder a standard tactile push button upside down on the PCB below the modified Cherry MX switch as shown below.
I used brow Cherry switches which have an actuating force of 0.5 N and tactile push buttons which have an actuating force of 1.6 N, so the difference between the first and second state is significant, so it is difficult to press by accident the wrong action. I modified the Cherry MX switch so that the 'plunger' could actuate the second button. This was achieved by removing partly the centering 'pin' of the switch as shown in the picture.
LayoutI reduced the amount of keys to 66 physical keys, some of which were double action. When counting double action keys and the normal keys the total is 66 + 34 = 100 plus a 5-direction joystick, this equals to a traditional keyboard. Because it has fewer physical keys than a normal keyboard it is smaller and more comfortable to use. The arrangement of the keys is also unusual. As shown in the picture enter, backspace, shift, delete and the arrow keys are all in the middle so they can be operated easily with both hands. In addition, the rows of the keyboard are not staggered, which makes typing easier.
Number keys are arranger in a similar fashion as on a number pad, but as second action keys.
Characters in black are primary keys, characters in gray are secondary keys and characters in red are FN keys that can be accessed by pressing the FN key.The building process I designed the PCB for the keyboard with Kicad and milled it with my cnc milling machine. I am using a Teensy 3.2 as the controller.
The switches are connected to a 9 x 14 matrix where each row is pulled down with a pull down resistor and each column can be activated separately (set high) with the controller that allows reading the states of all switches by using 14+9 IO pins. After the electronics were ready I designed a case and milled it out of wood.
ProgrammingThe double action keys have two different functions, so there are some challenges how the functions are triggered. I found that the best solution was to make the logic so that if a key is pressed two steps down the secondary function is triggered immediately as would on a normal keyboard, however the first action is a bit more tricky. If the key is pressed only one step the keyboard can't send the keypress immediately since it might be that the user is still going to press also the second step, that would lead to a situation where both actions are triggered instead of only one that was intended to be triggered. The solution is to make it so that the first action is triggered when the key is pressed one step and then released or when the first step is hold down for a longer period of time than defined in the program (300 ms works fine).
To recap if you want type the first action you have to press the key one step down and release it (this gives one character) or keep it pressed longer than the delay time (when you need many characters), if you want to type the second action you need to press the key two seps down faster than the delay time.
The modifier keys are programmed so that they lock down when a 'normal' (not a modifier key) key is pressed while a modifier is hold down and released after the normal key is released, this makes shortcuts easier to press. If the modifiers would not lock down the modifiers would have to be kept pressed longer than the normal keys, because the normal keys are sent after they have been released (or pressend long enough, but it would be slower).
ConclusionAfter having used this keyboard for a while it has proven to be quite useful, since typing special character is so much easier than before. All in all I would say that the keyboard is way better than the keyboard that I earlier used.
-jlv