Page 1
Standard

Hand-wiring a keyboard

As part of an effort to teach myself hardware design, I’ve wanted to hand-build a keyboard. I ordered a top and bottom plate from Ortholinear Keyboards a couple of months ago (their 60% Atomic Semi-Standard design), but didn’t have the switches I needed to put it together. Recently I received a set of Gateron switches through a group buy, and started work on the keyboard.

One of the reasons I chose the Atomic kit was frankly that it was one of the least expensive options available to get started. The kit includes the top plate (a steel plate with holes cut to place the key switches), and a bottom plate that has matching screw holes to the top plate. A bag of screws and brass spacers allows one to attach the two plates. It is a very simple design. There is no circuit board to attach the switches to like most other keyboard kits. The Atomic needs to be hand-wired. That appealed to me as well, because I felt hand-wiring the keyboard internals would give me a much better understanding of its inner workings.

To start one simply pushes the switches into the holes in the top plate. The switches are designed to fit a plate, and snap into place. I used Gateron (Black variety) switches. Gateron switches are a clone of Cherry switches, the mechanical key switch standard, whose patents expired in the past few years. Gateron, Greetech and Kailh are some of the companies making clone switches, and Gateron are some of the best reviewed switches. The color (in this case Black) refers to the variety of switch – a combination of actuation force (how strong the internal spring is), and whether Linear, Tactile or Clicky. Cherry MX Blacks, and their Gateron clones, are linear switches with a 60n actuation force.

Once the switches are inserted, the hard part starts – soldering the connectors on the back side of the switches. Switches have two contacts on their bottom side. One contact is connected to the other switches in the same row, and one contact is connected to the switches in the same column. This design is called a matrix, and allows the micro controller inside the keyboard to determine which key has been pressed, using less wire connections than would be necessary if you tried to connect every key directly. It depends on your micro controller and the number of keys on your keyboard, but when building a keyboard you will almost always need to use a matrix design. In this keyboard’s case, there are 66 keys and only 24 places to connect wires. By using a matrix, I can instead connect the 5 rows and 15 columns, and use only 20 connections, thus staying below the limit of connections on the Teensy 2.0 micro controller I’m using.

As an example, a simple 4×4 matrix would look like this:

4x4 Keyboard Matrix
4×4 Keyboard Matrix

The red lines make up to row connections and the blue lines make up the column connections. The bumps in the column connections indicate that the wires don’t connect even though they overlap. In this case, there are 4 columns and 4 rows, and thus the micro controller would need 8 connections to read the key usage on the keyboard (8 connections for 16 switches).

Rows

In order to prevent ghosting in the keyboard (where the keyboard makes a mistake recognizing multiple key presses) diodes are added to each key switch. One thing I realized when looking at what other people had done when hand-wiring their keyboards, was that is was common to use the diodes themselves to connect switches in the rows. A diode lead is soldered directly to one of the switch contacts, and then the second lead is soldered to the second lead of the next diode. That might sound confusing, but it’s important. The connections between the diodes must be made such that the connections take place only between the second leads, creating a kind of rail that connects the leads, and creates a connection that cannot send electricity back up to the switches due to the diodes (which only allow electricity to flow in one direction). So one lead on the contact, and one on the next switches’ second lead. You continue in that pattern until you get to the end of the row.

The leads are only long enough to make the connection between regular size keys. If a larger key is used (like normally used for modifier keys like Shift, Tab, Backspace, etc. and the Spacebar) then the space is too long for the lead to reach across, and another solution is needed. In the case of the 2u modifiers (there are three in the Atomic layout) I simply soldered piece of diode leads that I had cut off previously (the part of the lead that attaches to the switch contact needs to be trimmed after it is soldered) to bridge the gap. For the spacebar, since it is significantly longer, I soldered a piece of wire to either side.

Here’s what the keyboard looks like with just the rows wired up (using the diodes):

atomic-rowswired
Rows wired

There’s a difference between the rows and columns that is not clear from the diagram above. The columns are simply connected directly from contact to contact, since there are no diodes in the columns. This also means that there is no difference where you connect to the columns. The column is turned on, so to speak, by applying electricity to the whole column, so it that can be done anywhere. While the diagram shows the outgoing connections at the bottom of the diagram (similar to the row connections at the right of the diagram), the columns in reality end at the last switch in that column, and the connection can be made to one of the internal switches in the column (if that’s easier to fit the wiring), whereas the rows must be connected to at the end (after the last diode).

Columns

To wire the columns, I probably would have used solid-core wiring if I had had it, but I didn’t, so I used the bundle of wiring that Ortholinear sent with the plates, which is stranded wire. Since I wired the rows using the diode leads which are not insulated, the column wires must be insulated since they overlap the rows and would short if they were not insulated. After looking around at how other people had approached wiring up columns I came up with a technique that worked for me. What I did was strip the end of a segment of wire, which would be connected later to the bottom switch in the column. I then measured the distance to the next switch and made a cut in the insulation so I could pull the insulation up the wire a bit, creating a small gap in the insulation. It was important to measure to a couple of millimeters before the switch contact, and then pull the insulation so it created a gap a couple of millimeters past the contact, giving me enough space to solder the contact to the gap in the wire. After creating the gap, I would then measure to the next switch and repeat.

The reason I couldn’t measure all the distances at once was that I was pulling the insulation up the wire each time I created a gap, so any measurement marks I made earlier further up the wire would be moved. It was a bit time-consuming, but worked well. Once I had the wire for the column set up I pulled it under the row wires and positioned it next to each contact. I then soldered the bottom contact to the end of the wire and worked my way up the column until all the gaps were soldered to their proper contacts. The wire I had was color-coded, so I alternated colors across the columns, and made sure the colors followed the same order as the roll of wire, which came in handy later when connecting everything up (as you’ll see below). Here’s the keyboard with the columns wired:

Columns wired
Columns wired

You’ll note that the columns are not perfectly straight, because some keys span more than one column. When you have a wide key, you need to just pick one column to connect to that switch. To figure out which column would be assigned to which switch, I just decided on a rule that when there was a question I would connect to the left-most column the key spanned. On the bottom right of the keyboard above (actually the bottom left when the keyboard will be finished and flipped, but for this picture, it’s the bottom right) I just connected the bottom switches to the column they were closest to (they are off-center because they use larger keycaps). To guide me, I created a diagram like the above matrix diagram, but specific to this keyboard:

Atomic Semi-Standard Matrix
Atomic Semi-Standard Matrix

The reason it’s a good idea to make a diagram isn’t actually for wiring it, where a set of consistent rules should work well. The reason you need a diagram is that when you’re done and you want to program the controller, you’ll need to know how everything is hooked up. Having a diagram to look at can be simpler then referring to the actual hardware.

One thing to keep in mind. Technically the diagram above is backwards. We’re looking at the diagram the same way we’re looking at the back of the keyboard. The problem is that the software we’re going to load in the keyboard looks at the keyboard from the front. It also numbers the columns and rows starting from 0, so a more accurate diagram might be:

Atomic Semi-Standard Matrix (Corrected)
Atomic Semi-Standard Matrix (Corrected)

The firmware code actually uses hex numbering so there is no 10, 11, 12, 13 and 14, rather they are A, B, C, D, E and F. Since I’m using C and R to indicate Column and Row, however, I think it’s easier to label the switches using numbers.

Connecting the Rows and Columns to the Microcontroller

The next step is to connect everything we’ve done so far to the microcontroller, in this case a Teensy 2.0. Each column (15 of them) and each row (5 of them) need to be connected to the Teensy. Luckily, the Teensy has over 20 connections. The simplest thing to do is connect 10 wires to each side of the Teensy. In order to keep things organized, I decided to take the roll of wire I had, which was a strip 10 wires wide, consisting of insulation that came in ten sequential colors, and solder the wires to the rows and columns without disconnecting the wires completely. This allows me to end up with two strip of ten wires still connected at the ends, ready to connect to the Teensy. To pull this off, it required a bit of advanced planning. One thing I wanted to do, was re-use the same colors I had used for the columns, in the same order, so for each column, I was continuing the same color on its way to the Teensy. This would allow me to identify the wiring quickly when looking at the connections. For example, the first column is brown, and that will end up being the first connection on the Teensy. I’ll be able to visually see the connection of the brown wire to the first Teensy connection, and know for each connection exactly where it goes. There are 15 columns, but only 10 colors, but that’s okay because the next 5 columns will be connected on the other side of the Teensy with the rows. I was careful to run the wires underneath the existing rows and columns, and tried to keep the wires within the space between the keys whenever possible. This is what the wiring looked like when I finished:

atomic-connection-wires-added
Connection wires added

All the wires now run to the gap underneath the spacebar. That seems like the logical spot to place the microcontroller, as it’s the only spot without a switch in it. The right side of the spacebar switch is bigger than the left side (since the switch is not centered) so I put the wires there. In retrospect, it might have been easier to do the above if I had left the bottom row of switches disconnected from the columns, to make it easier to run the wires in the space between the switches. It wasn’t too bad, but it did require some delicate pulling of wires under the column wires which could have easily snapped in some cases.

Making the Teensy removable

I decided the project wasn’t difficult enough, so I’d make it harder (that’s a joke). I wanted to be able to remove the Teensy from the keyboard at a later date without having to desolder it. Normally one would just solder the wires to the holes along the Teensy and be done with it. Making it removable required figuring out something clever to connect the wires to the Teensy without solder. What I came up with was to use dupont micro connectors. I ordered connectors that were 10 units wide. When I ordered them I wasn’t even sure they would line up properly with the holes on the Teensy, but luckily they did. The male side of the connector has pins on both the bottom and the top. I soldered the bottom pins into the Teensy, with one on either side of the Teensy.

Teensy 2.0 with 10-unit connectors soldered on
Teensy 2.0 with 10-unit connectors soldered on

I then separate the ends of each wire coming from the rows and columns, and stripped the ends. The trick here is that the stripped section of wire has to be really short. One’s inclination is to give it a little extra space as you might do when soldering, but if you leave extra space here, the wire won’t fit properly in the dupont connector. Once I stripped all the wires, and practiced crimping the dupont connectors on extra wire I had, and then practiced inserting those connectors into the plastic female housing that held the ten connectors. This took a lot of practice, and I messed up a lot of connectors before getting a good feel for how it works. Even with all the practice, I ended up having to re-do two out of the twenty crimps that I did, but that’s not too bad.

Crimping the dupont connectors to the wires, in progress
Crimping the dupont connectors to the wires, in progress

Once I crimped all the connectors onto the wires, I inserted them into their housings and inserted the housing into their male counterparts on the Teensy. Along the way, I tried testing the connections using a multi-meter, just to make sure everything was working. This is what it looks like completed:

Dupont connectors inserted
Dupont connectors inserted

From a wiring point of view the keyboard is complete. There are three things left to do.

Close the case

First, we can close up the bottom. This keyboard came with a bottom plate with matching screw holes to the top plate. If you look at the photos above, there are brass spacers spread around the top plate in between the switches, six in total. I have black tubing around the brass spacers to prevent any wires from touching the metal. Those spacers have screw holes, so all I need to do is place the plate on top of those spacers and insert and tighten the screws.

Add keycaps

The second is to add keycaps to the switches (on the top of the keyboard):

Keycaps added
Keycaps added

You’ll notice that a few switches don’t have keycaps. That’s because I was missing a stabilizer bar for the spacebar when I added the keycaps, and I didn’t have the right keys for the 2u keys which will be the right-shift and enter keys. As I’m writing this I’m expecting both the stabilizer bar for the spacebar, and some blank 2u keycaps to arrive in a couple of days.

Program the keyboard

The third thing that is needed is to program the firmware. Keyboard have their own software that tells the micro-controller (the Teensy) how to interpret keystrokes. Ortholinear recommends TMK firmware, and they’ve made their own branch of the code with some of the settings for their keyboard kits – in addition to the Atomic (matrix 60%), there is the Planck (matrix 40%), Neutrino (staggered 65%) and Quark (staggered 40%).

One can do a lot with the software in a keyboard, but there are a few basics that need to be done. First, you need to map the connections on the micro controller to specific columns and rows. If the firmware doesn’t know what each connection is connected to, it can’t determine which key was pressed. In addition, you need to tell the firmware which switch should trigger which keystroke. You also need to tell the firmware how many columns and rows are in the keyboard. Advanced firmwares like TMK support layering, which means you can add multiple ‘layers’ of keys, so one layer might be what you think is normal for a keyboard with numbers and letters, while a second layer might have function keys and number pad (for keyboards like this one that don’t have function keys or a number pad), and a third layer might have special application-specific macros for applications like Photoshop, or for specific games. To start out I used the layout that was set up as the default for the Atomic.

Basically, I followed the roadmap in matt3o’s guide How to build your very own keyboard firmware on deskthority, with a few changes since Ortholinear’s branch of TMK is already customized for their keyboards. At first, when I tried to compile I ran into a string of error messages, but after asking Jack Humbert (aka Ortholinear) his thoughts on what was going on, he pointed out a single missing # in my code was causing it to fail. Adding in the # and everything worked.

Well, sort of. When I originally complied the firmware and got the keyboard working, the keymap seemed not to be exactly what I thought it would be. I don’t need to go into all the gritty details here, but let’s just point out that programming a keyboard from scratch is not something most people would ever want to do. Not only do you need to check the code, but you need to check the hardware to make sure your problems are not due to a soldering mistake. It’s not fun.

Finishing the Keyboard

In order to finish the keyboard, I needed two things. First, I needed to install the missing keycaps. All three missing keycaps used stabilizers, as all keycaps at least 2 units wide (i.e. twice the width of a standard key) need stabilizers in order to allow the key to press evenly across the entire key. After I received a 6.25u stabilizer bar for the spacebar, I installed that and the spacebar. After receiving 2u keycaps, I installed those on the stabilizers as well. Now all the keycaps were installed.

Second, I needed to make the USB port on the Teensy accessible. This is where some advanced planning would have helped a bit, but truthfully I started building the keyboard without the part I needed, so it wouldn’t have helped unless I had decided not to build the keyboard. The part I needed was a short USB extension cord so I could connect it to the USB port on the Teensy and run it in between the key switches and out the top of the keyboard. The advanced planning part would have been to run the extension cord in between the switches before all the soldering, so it would fit underneath the connections and stay in place. The problem I had after the fact was that I could not fit the extension cord underneath the connections without stripping the wire almost completely. That meant the plastic insulation was gone, and I would need to insulate the wire after getting it into place. I still haven’t found a great solution to this problem, although for the time being the USB extension cord is wrapped in electrical tape.

more
Quote

Freeman Dyson on scientists and engineers

A good scientist is a person with original ideas. A good engineer is a person who makes a design that works with as few original ideas as possible. There are no prima donnas in engineering.
Freeman Dyson, theoretical physicist and mathematician

more
Infinity ErgoDox
Standard

The evolution and commercialization of the ErgoDox keyboard

I mentioned the ErgoDox keyboard in my article A few interesting keyboards nearly in existence…. Strictly speaking, the ErgoDox was already in existence at the time (almost exactly a year ago), but as I pointed out, it wasn’t a commercial product. The ErgoDox keyboard was originally designed by Geekhack.org user Dox (aka Dominic Beauchamp), and developed in a thread started on October 10, 2011 titled ErgoDox – Custom split ergo keyboard with input from the Geekhack community. The design was based in part on the earlier Key64 concept, which itself derives its ideas from a variety of earlier keyboards, and partly from the layout of the Kinesis Advantage keyboard (in particular the thumb cluster).

The Original ErgoDox Design
The Original ErgoDox Design

What’s amazing, considering that hundreds (maybe thousands) of ErgoDox keyboards have been sold, is that Dox was originally hoping to get 5-10 people to commit to buying it to bring down his costs. When the design was completed, and the PCB finished (the PCB design was done by geekhack user bpiphany – aka Fredrik Atmer), the design was made available for free online.

 

MassDrop “Group Buys”

MassDrop ErgoDox
MassDrop ErgoDox

A kit containing all the parts needed to assemble the keyboard was made available first via MassDrop, a site that allows users to join “Group Buys” for various products, usually hard-to-get and/or very expensive electronics, that brings down the price based on how many people join the group buy. MassDrop has had several group buys of the ErgoDox in the past couple of years, offering the circuit boards (one for each hand), components (diodes, resistors, etc.), controller board (a Teensy 2.0), key switches, key caps, cables (USB for the computer, TRRS to connect the two sides), etc. The kit also contained a case made out of layered sheets of acrylic, based on a design by geekhack user Litster (the original 3D-printed case design by Dox was too expensive on a small scale).

Even though the kit components were sourced by MassDrop, and things like setting up custom keyboard layouts were made easier (by using an online configuration tool provided by Massdrop), it was still complicated to build, requiring the soldering of 76 key switches with 76 corresponding diodes, as well as many other components (resistors, LEDs, the controller board, the USB connection, the TRRS sockets, an I/O Expander chip, etc.). Additionally, the group buys didn’t provide a custom set of key caps for the ErgoDox, only optional blank keycaps. This could be explained by the infinite configurability of the keyboard layout not lending itself to a single set up for labels on their keycaps, but that is a cop-out of sorts. If the need to solder wasn’t enough of an obstacle, the lack of available keycaps was also an obstacle to wider adoption of the keyboard. Lastly, since you need to put the keyboard together yourself, there was no warranty on the keyboard available.

 

Mechanical Keyboards and Falbatech

Falbatech gold-plated ErgoDox PCB
Falbatech gold-plated ErgoDox PCB

In addition to the occasional group buy via MassDrop, ErgoDox components were also available from various sources. PCBs could be bought at Mechanical Keyboards in the US and Falbatech in Poland. Both companies also offered various case options, although many people built their own cases, either from the original Dox 3D-printed case design, Litster’s cut acrylic design, or various other custom designs. Falbatech sells a component kit with all the bits and pieces one needs to solder to the PCBs as well, although most of the parts could also be sourced from other providers such as Digikey (although not as a kit). These alternate providers made it possible for people to assemble ErgoDox keyboards whenever they wanted (and no have to wait for a new group buy on MassDrop) and also allowed users more flexibility in how they assembled the keyboards.

As people built their own ErgoDox keyboards, many modified the design to suit their own needs. Some broke out the thumb cluster and repositioned them. Some designed custom cases, even from wood. Other worked to upgrade the PCB to support LEDs on each switch. Many variations of the keyboard can be found online in groups like Geekhack, Deskthority, and r/MechanicalKeyboards.

 

The ErgoDox EZ

ErgoDox EZ
ErgoDox EZ

Last year I pointed out that it would be nice if the keyboard was manufactured in a factory and if the company that manufactured it offered support (i.e. a warranty). For many users, this is necessary. Apparently I wasn’t the only person who noticed this problem, as a couple of Israelis, Erez Zukerman and Yaara Lancet, put together a company to manufacture and support ErgoDox keyboards (dubbed the ErgoDox EZ). The EZ version of the ErgoDox is mass-produced in a factory in China, uses an injection-molded plastic case that brings down the cost, but otherwise is exactly the same as the standard ErgoDox. The PCBs are exactly the same, and the Teensy 2.0 is still used as the controller board. That last part was surprising to me because if I was going to mass-produce a keyboard, I’d want to embed the controller into the PCB for two reasons. I’d want to remove a third-party product from the final version to reduce costs (why include their markup into my base price?), and it would reduce the risk of problems caused by their manufacturing process. If someone is buying a mass-produced product, they probably don’t expect a removable controller board from another company. Of course, keeping the Teensy 2.0 board in the final product does have one major advantage – it means the company wouldn’t need to deal with any custom programming to adapt the ErgoDox software to a new controller configuration.

Keeping things simple (the only major change being the creation of a case that can be injection molded) might also explain why nothing in the key layout was changed either. Many people complained about the ErgoDox thumb cluster, for example, as not being ideally located. A whole thread on just this topic (fixing the ergodox thumb section) has generated hundreds of messages and thousands of views.

One other curious thing done by the EZ team was not including printed keycaps. Like MassDrop, the keycaps available are all blank. My opinion is that if they are looking to expand the market for the ErgoDox beyond those who can solder it together themselves, and those who want warranties, then chances are many of those people also want printed keycaps (see my article How many keys are there on a keyboard? for a discussion of the use of blank keycaps).

The ErgoDox EZ team did a pre-sale on its web site, offering the keyboard for $180 without keycaps or $190 with blank keycaps, in the run up to its IndieGoGo campaign, where the price was raised to $215 without and $235 with keycaps (plus $30 shipping). There was some promotion on the Deskthority keyboard forum (Assembled ErgoDox with warranty available for pre-order). Before promoting their IndieGoGo campaign, they offered the $180/$190 pricing on their IndieGoGo page for those who signed up earlier, then hid those levels once they launched officially. This got them about half way through the $50,000 they need to finish their campaign, which as of today (four days later) has 26 days to go.

 

The Infinity ErgoDox

Infinity ErgoDox
Infinity ErgoDox by MassDrop

Today, just days after the ErgoDox EZ launched on IndieGoGo, MassDrop dropped a bomb of sorts – a newly redesigned ErgoDox keyboard, they’ve dubbed the Infinity ErgoDox. MassDrop previously released a keyboard called the Infinity, which was created with input from the community and the professional direction of Jacob Alexander (aka HaaTa). MassDrop has an interesting article about the creation of the Infinity for those interested in the process. MassDrop took some of the lessons learned in the creation of the Infinity, much of the feedback from the community on the original ErgoDox, and created something new.

The new model outwardly looks fairly similar to the original ErgoDox (no thumb cluster change), but when looking closer, there are some significant changes. The Teensy 2.0 is gone, replaced with a built-in controller that is closer to a Teensy 3.1 in design. Each side can actually be used independently from each other, but when combined with a USB3 cable, merges into a single device. The unit connects to the computer using a simpler USB2 cable. The new design includes one obvious change, which is the addition of a small LCD screen on both sides of the keyboard. The screen is intended to be used to show different modes of the keyboard, which layout layer is activated, etc. although the software can be modified, so the screens could be used for lots of functions.

The case is still built from layered acrylic, although the plate that holds the key switches has apparently been switched to a metal plate.

Another big change which is not actually described in the group buy description, but fleshed out in the comments, is that the keyboard supports individual per-key LEDs. The original ErgoDox only supported 3 LEDs, and all on one side of the keyboard. The new Infinity ErgoDox has room in the PCB for individual LEDs for each key, and the PCB has a built-in LED controller chip to support them. The LEDs can be individually addressed and the brighten controlled. The group buy doesn’t actually include the LEDs, which is probably why they’re not mentioned in the description, but according to the responses in the comments, the hardware support is there already. It’s possible the software support for the LEDs is not ready yet, which might also explain why that was left out of the description.

Perhaps the most important change is that all of the main components are added to the PCB during manufacturing, leaving only the switches which need to be soldered. That makes the assembly of the new Infinity ErgoDox much simpler than the original ErgoDox. If you add LEDs those will also need to be soldered, but they are not necessary to the keyboard’s operation.

 

What’s next?

I’m sure the ErgoDox EZ folk were not happy to see the Infinity ErgoDox launch four days into their campaign. It’s true that the ErgoDox EZ is the only version of the ErgoDox that so far will be available with a warranty. The Infinity ErgoDox does not include a warranty. Being only half-way through their fundraising goal (with 165 contributors, compared to the 280 the Infinity ErgoDox racked up today so far) they must be sweating a bit. They have a choice – they can continue and hope to get everyone who do not want to solder their keyboard switches, and those that want a warranty – or they scrap their current design and wait for MassDrop to release the new versions of their PCB design. MassDrop has announced that the designs for the Infinity ErgoDox will be released to the public after the product ships. The estimated shipping date is June 29, 2015 – three months from now. They could wait until the after it is shipped, get the new designs, and relaunch with the new design.

A third option, and probably the best option, would be for them to add stretch goals to their existing campaign that include many of the improvements in the Infinity ErgoDox, perhaps even other improvements, and commit to include those improvements in the final product (whose ship date is currently estimated to be December 2015). They could even simply add a stretch goal to use the Infinity ErgoDox design, and then they don’t need to make any new hardware designs, they only need to create a different case (which they still haven’t made, so requires very little additional work).

In any case, it’s fascinating to see what started out as a personal design intended for a handful of people, being the basis for products manufactured by many companies (besides the 4 companies mentioned here, there are many others that have made accessories such as wrist guards and custom keycaps for the ErgoDox). I don’t know if the ErgoDox EZ will make it to production and offer the first ErgoDox with a warranty, but if it does it will be a pretty big breakthrough for community-developed keyboard designs. The improvements implemented by MassDrop are also a breakthrough of sorts, taking community designs, improving them, and releasing the changes to the public. This is the open source software world merging into the world of hardware. About time.

more
Quote

Chris Carter on commercialization

So many things for me are unfortunate in the commercialization of something that is special. It’s like when Led Zeppelin appears in Cadillac commercials. There’s something that is taken away from your love of this thing and your connection to it.
Chris Carter, television and film producer, director, and screenwriter

more
Standard

How many keys are there on a keyboard?

Longtime readers of this blog might have noticed my interest in computer keyboards. Most people today just use the keyboard that comes on their laptop, or the virtual one on their tablet. The basic layout of the keyboard dates back over a hundred years to early typewriters, but the more modern layout of the keyboard dates back to 1986 and the emergence of the IBM Enhanced Keyboard for the Personal Computer, which debuted the 101-key layout which has become the standard full-size keyboard layout to this day. Microsoft bumped the layout to 104 keys with the addition of Windows keys and a Menu key a bit later, but the layout is essentially the same. This is a rule-of-thumb, as no two keyboards are exactly the same. The number of keys on a full size keyboard varies, some having media keys, etc. The layout, more or less, is the following:

Full-Size Keyboard Layout
Full-Size 104-Key Keyboard Layout

It’s worth pointing out that the 101/104 layout is the standard layout in the US, called ANSI (American National Standards Institute), while in Europe there is slightly different 102/105 key layout called ISO (International Organization for Standardization). The ISO layout has an extra key (to the right of the left-side Shift key), but also changes some of the layout, using an L-shaped Enter key instead of the  straight ANSI Enter key (as above), as well as changing the function of the right-side Alt key (called Alt Graph) to allow for simpler access to more characters (i.e. Left-Alt and a key will produce one character, while Right-Alt and the same key will produce another character). This simplifies the generation of accented characters that are not generally used in the US.

Key Blocks

In the above diagram I’ve broken down the layout into four blocks – Basic, Function Key, Navigation and Number Pad. When all four blocks are present, you have a standard full-size keyboard. Remove the Number Pad block on the right side, and you have an 87/88 key layout (87 in ANSI, 88 in ISO). Keyboard enthusiasts refer to this as Tenkeyless (TKL). Why Tenkeyless? I have no idea. There are actually 17 keys in a standard number pad. I suppose there are ten number keys in a number pad. In any case, most physical keyboards conform to either the 87/88 or 104/105 layout. Laptops of course, throw out most of these standards in an effort to fit the keys they need into a much more constricted space. Usually a laptop will include the Basic Block, the Function Block (although with smaller keys), and jam the 4 arrow keys of the Navigation Block somewhere into the keyboard (for example, by shrinking the spacebar, removing a control key from the right, and sticking small arrow keys in the bottom right corner). We’ll get back to that in a minute.

Gaming Keyboards

While most keyboards not bundled by computer manufacturers are still probably produced by big companies like Microsoft and Logitech, there are many keyboard companies that try to reach smaller niche markets. One very large niche market is the gaming market, where keyboards that allow gamers to more easily press many buttons at once, allow programming the keyboard to optimize it for specific games, and where they can pimp out their keyboard with backlighting and special keys to look cool when competing. The largest company to target this particular market niche is California-based Razer, which was valued at $1 Billion in a recent investment round led by Intel. Razor has expanded from its original pointer devices and keyboards to produce gaming laptops, wearables, and other consumer electronics devices.

Big companies like Logitech manufacture keyboards targeting gamers, but there are also many smaller companies that sell primary to the gamer market. Besides Razer, other companies include Cooler MasterCorsairRoccatSteelSeries, and Tt eSports.

Programmer Keyboards

The next large keyboard niche is computer programmers. Programmers, by dint of the amount of time they spend in front of a keyboard, have more requirements in general than the average user, and are also more willing to use more technical solutions to keyboard problems. These technical solutions can include keyboard layers, where the user can switch the entire layout of the keyboard on the fly, chording, where users use combinations of key presses to output what they want instead of using single key presses, and programmable keys and macros. The first keyboard I’m aware of that targeted programmers was the Happy Hacking Keyboard (HHKB), which was introduced by a division of Fujitsu in 1996. The HHKB reduced the key count to just 60 keys, leaving just the Base Block from the above diagram, and overlaying the Function Block and the Navigation Block onto existing keys, using a special function key to access those keys (and printing the function-enabled key labels on the front of the keycap in addition to its standard label on the top – see below).

Happy Hacking Keyboard Professional2 Type-S
Happy Hacking Keyboard (HHKB) Professional2

Another milestone keyboard targeting programmers was the Das Keyboard, introduced by open source software company Metadot Corporation in 2005. The original Das Keyboard introduced, or at least popularized, keyboards with blank keys. The idea for the keyboard was conceived by the CEO of Metadot, who realized that looking at the keyboard when typing was a crutch, and slowed down one’s typing. The idea is that by using blank keys, one could force themselves to touch-type and increase your typing speed dramatically. Other keyboards that target programmers include the CODE Keyboard, the Humble Hacker Keyboard, and the upcoming Ultimate Hacking Keyboard.

The Overlap

While gamers and programmers have different needs, there is a lot of overlap between the specs for gaming and programming keyboards. For example, programmability is very common for both types of keyboards, although for slightly different reasons. Gamers need to optimize the keys for specific games and create macros for common key-combos. Programmers optimize for the languages they use, and for their particular coding style. Gamers tend toward larger keyboards with lots of buttons that insure they can control all aspects of the game they are playing, while many programmers actually use smaller keyboards to keep their range of movement to a minimum. Both groups of keyboards tend towards using mechanical switches such as Cherry MX switches (and their many clones such as Gaote, Greetech and Kaihl), and in some cases there is overlap where keyboards are used both for programming and for gaming. On the other hand, it’s unlikely you’ll find a gamer using a small keyboard with blank keys. What is a ‘small’ keyboard?

75% Keyboards

As mentioned, there are keyboards referred to as Full-Size (101/102/104/105 keys) and there are keyboards called Tenkeyless (87/88) where the number pad is dropped. What if you drop the navigation block as well (sometimes arrow keys are kept)? Then you get just the Base Block and the Function Key Block. This is a configuration frequently used in laptop keyboards. Here’s an example of the keyboard layout on an Apple MacBook Pro:

MacBook Pro Keyboard Layout
MacBook Pro Keyboard Layout

Note that the function keys are smaller than the other keys, and that the arrow keys have been squeezed into the bottom right corner (by removing some of the right-side modifier keys and keeping the arrow keys small. This is a 75% Layout, where there are roughly 75% of the keys found on a full-size keyboard. This kind of layout is unusual for a separate keyboard, but it does exist. Some examples of non-laptop 75% keyboards are the Matias Mini TactilePro, the Keycool 84, the KBC Race II which was developed by the KBtalking keyboard community in Taiwan and manufactured by Vortex, and the BL82 keyboard manufactured by TG3 Electronics.

60% Keyboards

If we keep going, what happens if we drop the Function Key Block as well, so it’s just the Base Block? We have roughly 60% of the keys of a Full-Size layout, and thus a 60% Layout (which usually has somewhere between 60-66 keys). Some keyboards that use a 60% Layout also figure out ways to cram in arrow keys. Some versions of the Happy Hacking Keyboard (HHKB) for example, squeeze in arrow keys in the bottom right corner, even while dropping the whole top row of function keys. What happens if you need the function keys you ask? or even the arrow keys if they’re not there? Most of the keys that are removed in the 60% keyboard are mapped to other keys, and accessible by holding down a modifier key. Thus, F1 through F12 are usually mapped to the number row (F1 to 1, F2 to 2, etc.). 60% Keyboards are popular in keyboard enthusiast groups, as a kind of minimalist keyboard. They are also popular with some programmers who prefer the minimal design which reduces the distance they hands must move to reach the entire keyboard, and the distance to reach an external pointing device such as a mouse (on a full-size keyboard, for example, reaching over the navigation block and the number pad block to get to a mouse is far).

Below is the Happy Hacking Keyboard Lite 2 layout (a variation on the original layout shown above in the photo, which adds four arrow keys). It shows which characters are accessed via a function key in red:

Happy Hacker Keyboard Lite 2 Key Layout
Happy Hacker Keyboard Lite 2 Key Layout

You can buy 60% keyboards such as the Ducky Mini, the Filco Minila, the Happy Hacking Keyboard, and the Leopold FC660M. There are also community-designed company-manfactured 60% keyboards, such as the Vortex (the company) KBC (the community) Pok3r II (soon to be the Pok3r III) and the KB Paradise V60 Mini. In addition, there are several 60% keyboards available in kit form for those who are willing to assemble them by themselves. Some of these kits are community-designed, such as the GH60 and the Massdrop Infiniti, and some are individually designed, such as the Atomic and the Lepton.

40% Keyboards

While many consider the 60% to be minimalist in design, there are some people designing even smaller keyboards that drop the entire number row and other keys, forcing the use of a modifier key to access numbers and other keys that are dropped from the keyboard. There are no commercially produced 40% keyboards that I’m aware of, although there are some community and individual-designed keyboards available. Some kits are available, such as the Planck (the 40% sibling of the 60% Atomic above), the Terminus Mini, the Atreus, and the SmallFry (aka the JD40).

At first glance, you might think it’s crazy to get rid of the numbers and require one to hold down a modifier key to type a number. However, if you think about it, we already use a modified – the Shift Key – to reach all the characters currently mapped to the number keys, which are !, @, #, $, %, ^, &, *, ( and ). Why is that different to use a second modifier key to reach the numbers from existing letter keys? One problem that emerges is the keycaps. If you’re using blank keycaps, I guess you’re fine. Otherwise, how are you going to get keycaps that show you the modifier-layout that you require to access the keys you lost? Those Shift-modified characters (above) also need a place on the keyboard, either on the same keys you move the numbers to (add the Shift) or somewhere else, but either way, you need to know where they are. Are you going to put three characters on a single keycap (i.e. Q, 1 and !)? Besides being difficult to source such keycaps, they would most likely be expensive. In all the builds I’ve seen of these keyboards, they either use blank keycaps, or they just use the letters and leave out the numbers. The numbers are of course easy enough to guess (there are 10 letters across the top), so I guess that works in a way, but if you rely on printed keycaps, figuring out the location of other characters can’t be easy. This is something that a commercial 40% keyboard might be able to fix, although for the moment, these seem to be strictly hobbyist-made.

Can there be a 20%?

If you follow the above trend, you might wonder if there could be a 20% keyboard. Strictly speaking, sure. You’d need to do a lot of chording (pressing multiple keys at once to get the correct character). In general, if a keyboard has 20% of the keys of a full-size keyboard, you’re talking about a one-handed keyboard. They exist, to be sure, but they are niche products. One one-handed keyboard I always liked was the FrogPad, created by Linda Marroquin, based on the design of a Japanese translator who wanted to be able to hold a page in one hand and type using the other hand. If you take a close look at the layout of the FrogPad, it has 20 keys and they have up to seven different characters or functions related to them.

Right-Handed FrogPad
Right-Handed FrogPad

Take a look at the top right key. If you press it by itself, it’s P (top side, upper left in white). If you hold down the Space (which has a green square on it) it’s J (top side, bottom left in green). If you hold down the Shift key, it’s a semi-colon (top side, upper right in white). If you hold down the Space and the Shift, it’s a number sign (top side, lower right in green). It can also be Page Up (front left in orange), minus (front right in white), and Number Lock (left side in yellow) depending on what other keys you press.

A later iteration of the keyboard added another 11 keys, which included function keys and others, although I’m not sure that ever made it to market. It seems there are lawsuits involved as Marroquin had licensed the design to a third-party company, and that third party took money for pre-orders that were never delivered. Marroquin now seems to be trying to rejuvenate the product.

One enthusiast-developed 20% keyboard is called the OneHand, designed by Deskauthority forum user PJE. It has just 18 keys, and similar uses chording to achieve the full number of characters and functions needed.

One other thing about the FrogPad which is worth pointing out is that the layout is not staggered. In keyboard design it’s called ortho-linear, or matrix layout. In other words, the keys are in a grid, not staggered like most keyboards. It’s not unique to the FrogPad. Indeed the Maltron and Kinesis Advantage ergonomic keyboard have been using matrix layouts for years (see all three in my earlier article Why haven’t there been any keyboard innovations in decades?), as well as the ErgoDox, Keyboardio, and King’s Assembly keyboards (all mentioned in my earlier article A few interesting keyboards, nearly in existence…).

Conclusion

I suspect most people don’t think much about any of the above when buying a keyboard. In fact, most people don’t buy keyboards at all anymore. That said, for those interested in a higher quality keyboard than what is available on their notebook or tablet, want a specialized keyboard for gaming or other niche pursuits, or need a more ergonomic keyboard, these issues are important. Perhaps next time you look at a keyboard, you’ll understand what keys it has, and what was left out – and why.

more
Quote

Douglas Rushkoff on web sites

Web sites are designed to keep young people from using the keyboard, except to enter in their parents’ credit card information.
Douglas Rushkoff, journalist and media theorist

more
PythonTurtle
Standard

Teaching Computer Science (in Saudi Arabia)

Recently I came across two computer programming products, whose creators have mentioned they’re being used in the high school curricula of Saudi Arabia. The reasons I was looking at the these two products were not connected, so I thought it an interesting coincidence that I came across similar stories twice in about a week.

The first product was a learning program called PythonTurtle, created by Israeli developer Ram Rachum.

PythonTurtle
PythonTurtle

Python, for those who don’t know, is a popular computer programming language. Turtle is a reference to the ‘turtle’ used in the Logo programming language, which is an icon or point that shows the current position of the cursor on the screen when drawing using Logo. Logo is an early computer language developed specifically as an educational tool for teaching programming (and one of the test schools where it was used was my elementary school in Brookline, MA). The goal of PythonTurtle was to create a learning environment similar to Logo, but using the modern (and more useful) programming language Python.

Ram Rachum developed PythonTurtle six years ago and released it as open-source software. Last year he started noticing a large number of traffic to his site from Saudi Arabia, although he didn’t know why. He also noticed that the traffic peaked in January – both in 2014 and 2015. A few weeks ago he received an answer to his question, when a teacher from Saudi Arabia explained that PythonTurtle has been integrated into the high-school curricula of Saudi Arabia, and is being using in thousands of schools by hundreds of thousands of students.

The second product I came across was AppStudio by NS Basic.

appstudio
AppStudio

AppStudio is a commercial development environment that can use either the BASIC or Javascript programming languages to develop application for Android and iOS smartphones. I came across it in a promotional link. I was looking for something else, but glanced at a list of discounted apps and noticed AppStudio. Curious about it, I took a look at the web site, and noticed several posts about Saudi Arabia – two press releases from December and an article published on the web site edSurge from February – titled How We Taught Computer Science to 225,000 Students in Saudi Arabia.

From the article, it appears that in the case of AppStudio, they were contacted directly by the Saudi Ministry of Education. The company sent at least one person to Saudi Arabia to train teachers and help develop the curriculum. Over the period of five months, from January to May 2014, a 150-page programming curriculum was developed, and thousands of teachers were trained. One line gave me pause in the article:

“The simple, top down organization of the Ministry means they have the ability to quickly accomplish what would take years in western school systems.”

Top-down is one way to describe Saudi Arabia. Perhaps the top-down nature is what also allowed the Israeli-developed program PythonTurtle to be used in its curricula, when Saudi Arabia has no diplomatic relations with Israel and doesn’t allow anyone with an Israeli stamp in their passport to visit the country (let alone someone with an Israeli passport). It seems clear Ram Rachum was not invited to train teachers on the use of PythonTurtle, but at least it’s being used, right?

The article also explains that there are two semesters of computer programming in the Saudi curriculum, both in tenth grade, the first covering basic programming skills, and the second covering mobile development. It would seem likely that PythonTurtle is being used in the first semester and AppStudio is being used in the second semester.

I think it’s great that Saudi Arabia is integrating computer programming into its nationwide curricula. More countries and school systems should be doing similar things. I would suggest that schools look to integrate it earlier than tenth grade though, as it might not make as great of an impression at that point. I learned to program Logo in third grade, because my public elementary school took part in an experimental program to teach programming to children from MIT. I think third grade is probably a good time to start learning programming. Not just because I learned it then, but because my oldest child is currently in second grade, and I can see her being ready to learn programming next year. At the very least, however, I think children should learn to program while still in elementary school (primary school for those who use that term).

Not everyone will be a computer programmer (nor should they be) but early recognition of those who have natural skills for programming would be useful in encouraging those children to take more advanced courses in high school and beyond. Computer programming is an important skill in a whole slew of fields beyond high-tech, from science and mathematics, to finance and engineering. Even for those student who never program anything again, it teaches important skills like logic and analytical thinking.

Congratulations to Saudi Arabia for having the foresight to teach computer programming to all of its students. I hope Saudi Arabia will be tracking the influence of this new policy and publishing analysis of this new program, so other countries and school systems can learn from their experience.

more
Quote

Seymour Papert on Video Game Creators

Every maker of video games knows something that the makers of curriculum don’t seem to understand. You’ll never see a video game being advertised as being easy. Kids who do not like school will tell you it’s not because it’s too hard. It’s because it’s boring.
Seymour Papert, AI pioneer and creator of Logo

more
Standard

From bibles to web sites, the century-long trek of one font

I appreciate a good font, and I certainly appreciate good typography. Reading badly laid out books can be painful (although my threshold is much higher than my friends who are typographers by trade). The over-use of Comic Sans or Papyrus fonts is not something that just bothers me.

Part of the first page of the Doves Press edition of the Bible
Part of the first page of the Doves Press edition of the Bible

Recently I read about the resurrection of a font last used over a century ago. The story is quite incredible. Two men founded a publishing company, one bringing the creative side (Thomas Cobden-Sanderson) and the other the money (Emery Walker). The company, Doves Press, created a new font (new, although based on a font from the 15th century) to be used in their publications, which included an edition of the Bible, as well as books by well-known authors such as John Milton, whose Paradise Lost published by Doves is nothing less than a masterpiece of bindery, before even getting to the contents.

paradiselost
Paradise Lost, published by Doves Press (The Met)

Trouble Begins

When the publishing company ran into financial trouble, the partners fought over the single remaining asset of the company – the typeface. Today we think of fonts as digital files on a computer. We don’t think about how much time goes into designing them, especially since anyone who wants to can open up a computer program and create their own font. Not so with fonts a century ago. Fonts such as that used at Doves Press took years of planning and production time to create. A single font consisted of thousands of pounds of metal characters on small plates used to form the words that were printed.

The Doves Press typeface was owned by both partners equally, but that created a big problem. One partner wanted to sell the typeface (Walker), the other wanted to prevent it from being used in a mechanical press (Cobden-Sanderson). Instead, they came to a different agreement. Cobden-Sanderson would retain full control of the font during his lifetime, and after he died Walker would gain complete control of it. While that sounds reasonable, it wasn’t enough for Cobden-Sanderson that his font would never be mechanized in his lifetime. He decided to, frankly, screw his business partner out of his end of the deal. Over a period of years, he carried small amounts of the type to the Thames River and dumped them into the water. After hundreds of such trips, he managed to dispose of the entire typeface, leaving nothing for his partner upon his death.  Nothing, that is, except the story.

The Legend and The Resurrection

The story became legend, and after a century, one designer, Robert Green, decided to try to resurrect the lost typeface. Starting with copies of books published by Doves Press, reading the journals left behind by Cobden-Sanderson, and using research done by others on the topic, Green attempted to piece together a full copy of the typeface, as well as find the location of the lost original. Figuring out where Cobden-Sanderson likely dropped the metal pieces into the river, he actually was able to find three pieces of the typeface himself on the water’s edge. After that discovery, he was able to get professional divers to search for the rest, where over 150 pieces were discovered. The rest are likely encased in concrete, as the bridge the typeface was thrown over was bombed multiple times by the IRA, as far back as 1939 and as recently as 2000, and the bridge had to be repaired each time.

The pieces recovered from the river do not constitute the full range of characters from the typeface, but they do help provide more information about the typeface, and that information has been used by Green to enhance his digital version (he calls it a ‘digital facsimile’) of the font, named The Doves Type, which is available for sale online.

Digital Embedding License?

Looking at the new font online, I noticed something interesting about the pricing. The font is sold for £40 for a single user, £50 for 2-5 users (it’s reasonable that someone working on a book would need a license for more than one person), and the third option is £40 for 10,000 page views per month on a web site. All of that seemed fairly standard to me, although I’m not an expert on fonts and I always thought it was a bit strange to price fonts for online use based on page views. What I found really interesting was that they ask to be contacted directly if you want a larger online license or a ‘digital embedding license’. The examples given for the digital embedding license are apps and eBooks.

dovestype-contactus

Think about that for a second. For £40 I can install the font on my computer and print a million books using it, but if I want to issue an eBook of the exact same book, with the same layout, etc. I need to negotiate some kind of separate license. How does that make sense? Is it because the font is embedded in the document and thus has the potential to be extracted and used without permission? What kind of extra payment would cover that exactly? Font licensing has always seemed a bit arcane to me, but this seems particularly bizarre.

What would Cobden-Sanderson think now?

There is a certain amount of irony that Cobden-Sanderson went to such extreme measures to prevent his typeface from being used in the mechanical presses of the day, only to have it resurrected today in such a way that anyone in the world can use it. There’s no doubt that Robert Green has a tremendous amount of respect for the typeface and its creator, yet he is still responsible for releasing the font into the wild in a way Cobden-Sanderson would never have imagined possible (and probably would have been horrified by). John Milton once said that innocence once lost can never be regained. Cobden-Sanderson’s typeface is out now, and to use more colloquial terminology, that genie can never be put back in the bottle.

more
more