The prime building block: Layers

When you think of a layer, you might think of a delicious cake, or maybe the layers of clothing you wear to keep warm during the winter. So what are layers when it comes to keyboards?

Chances are that you’re already familiar with layers. If you have a laptop, you might know of the Fn key. It’s often marked with blue text, and when you press it, some keys on your keyboard that are usually letters or numbers do something different when you’re holding the Fn key. Functions that you don’t use often, like volume or adjusting the screen brightness, might be hidden behind the use of the Fn key. On some laptops, keys that you usually type letters with, might be used to write numbers instead when you hold the Fn key.

What that key does, is activate a layer: the Fn layer. Similarly, pressing Num Lock makes the keys on your numpad do something different on a full-size keyboard, toggling between navigational functions like arrows and PgUp and PgDn, and the actual numbers on the numpad. Effectively, Num Lock activates a layer specifically for the keys on the numpad.

How layers work

Let’s start with an example: a keyboard with just a single layer. This layer can also be called the base layer: it’s the layer that’s always active. Now, let’s add a layer with symbols. Additional layers don’t have a special name, they’re just called layers—but it helps to keep similar functions grouped on a layer so it’ll be easier to remember which key does what.

Layers are stacked on top of each other, with the base layer at the bottom. Using special keycodes, you can have buttons on your keyboard activate a layer. Then, when you press a button, your keyboard will check which layers are active, and then have your key do the thing mapped to it in the highest active layer in the stack of layers.