⌨️
The Ultimate Guide to Keyboard Layers
  • Overview
  • Ch 1: Keyboard Layers 101
    • 1.1 Keyboard Fundamentals
    • 1.2 Why Use Layers
    • 1.3 Layer Challenges
  • Ch 2: Setup
    • 2.1 Keyboards
    • 2.2 Firmware
    • 2.3 Independent Software
  • Ch 3: Layer Activators
    • 3.1 Modifier Layers
    • 3.2 Momentary Layers
    • 3.3 Toggle Layers
    • 3.4 One Shot Layers
    • 3.5 Dual Layers
    • 3.6 Tap Dance / Superkeys
  • Ch 4: Creating Layers
    • 4.1 Planning Layers
    • 4.2 Implementing Layers
  • Ch 5: Advance Layer Patterns
    • 5.1 Key Functionality Across Layers
    • 5.2 Color Coding Keys
    • 5.3 Thumb Keys
    • 5.4 Nesting Layers
    • 5.5 Categorizing Layers
  • Ch 6: Layer Examples
    • Layers
      • Default Layer
      • Shift Layer
      • Numpad Layer
      • Symbols Layer
      • Editing & Navigating Layer
      • Media Layer
      • Mouse Layer
      • Screen Management Layer
      • Context Control / Macro Layer
      • Browser Layer
      • VS Code Layer
      • Discord Layer
      • Slack Layer
      • Gaming Layer
  • Timeline
    • Keyboard Timeline
Powered by GitBook
On this page
  1. Ch 1: Keyboard Layers 101

1.1 Keyboard Fundamentals

PreviousOverviewNext1.2 Why Use Layers

Last updated 2 years ago

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.

Keymap: 32 Layers                   Layer: action code matrix
-----------------                   ---------------------
stack of layers                     array_of_action_code[row][column]
       ____________ precedence               _______________________
      /           / | high                  / ESC / F1  / F2  / F3   ....
  31 /___________// |                      /-----/-----/-----/-----
  30 /___________// |                     / TAB /  Q  /  W  /  E   ....
  29 /___________/  |                    /-----/-----/-----/-----
   :   _:_:_:_:_:__ |               :   /LCtrl/  A  /  S  /  D   ....
   :  / : : : : : / |               :  /  :     :     :     :
   2 /___________// |               2 `--------------------------
   1 /___________// |               1 `--------------------------
   0 /___________/  V low           0 `--------------------------

Picture of a keymap made from layers from docs.

QMK
qwerty layout
dvorak layout
colmak layout