1.1 Keyboard Fundamentals
Last updated
Last updated
A keyboard is an arrangement of keys that when pressed, sends a key code
to a keyboard driver. Key codes
are all the keys like Alphanumeric(a, b, 1, 2), modifier(ctrl, alt/option), arrow keys and many more. All the keys on a keyboard form a keyboard layout
that represents a collection of keys and their position. There are some common layouts that even have names such as qwerty, colemak, and dvorak that are shown below.
The purpose of a keyboard is to be an input device to communicate information to your computer. If a key outputs a single code, then there would be a one-to-one relationship, where each key gets a single keycode output. This is quite impractical and would require lots of rows and keys like in the picture below.
A key can instead have a one-to-many relationship with the help of layer activators.
Layer activators are the keycodes like the shift and capslock keys. When the shift activators is activated keys switch output from lowercase letters to upper case letters. This creates a one-to-two relationship, where one key can have 2 possible output states, lower and upper. When talking about just the lowercase keys or uppercase keys on the layout, it is called a layer
followed by a description word. So the starting layout is made of 2 layers, the default layer or base layer containing lower case keys and the upper, shift or caps layer containing the uppercase letters.
A layer is the collection of the keycodes with their position and typically have a theme
There are many more keyboard layers, such as the function layer(Fn), number layer and navigation layer and many more that will be discussed later. Together, all these keyboard layers can be grouped together to create a `keymap`. A Keymap is useful if you move between keyboards or want to share all the layers at once.
Picture of a keymap made from layers from QMK docs.