Having beautiful RGB lighting on your keyboard is one thing, but being able to control it on the fly is what makes it truly powerful and personal. The most common way to do this in the custom keyboard world is through QMK (Quantum Mechanical Keyboard) Firmware.
QMK is an open-source firmware that runs on your keyboard's microcontroller, and it gives you an incredible amount of control over every aspect of your keyboard, especially lighting. With the right tools, you can create stunning lighting effects and control them in real-time.
For many modern keyboards, you won't need to write a single line of code to control your lights. Many QMK-powered keyboards come with support for VIA or VIAL. These are graphical configurator tools that run on your computer and allow you to change your keyboard's settings in real-time.
Fn + W
to increase brightness, Fn + S
to decrease it, and Fn + D
to change the lighting mode.VIA stores changes in your keyboard’s non-volatile memory when supported. Keep a backup JSON of your layout and lighting preferences so you can restore them after firmware updates. When loading a board without an official VIA definition, you can often import a JSON keymap file supplied by the PCB vendor to unlock the UI.
If you want to dive deeper or your board doesn't support VIA/VIAL, you can program your lighting directly in your QMK keymap. QMK provides a rich set of keycodes specifically for lighting control.
You can place these keycodes anywhere in your keymap.c
file, just like any other key. Here are some of the most common ones:
RGB_TOG
: Toggles the RGB lighting on and off.RGB_MOD
: Cycles through the different animation modes.RGB_HUI
/ RGB_HUD
: Increases / Decreases the hue.RGB_SAI
/ RGB_SAD
: Increases / Decreases the saturation.RGB_VAI
/ RGB_VAD
: Increases / Decreases the brightness (value).RGB_SPI
/ RGB_SPD
: Increases / Decreases the animation speed.By placing these on a function layer, you can have complete, granular control over your light show without ever needing to open a piece of software.
QMK even allows you to create lighting layers. This is an advanced feature where the keyboard's lighting can change automatically when you switch to a different keymap layer. For example, you could have your base layer be a calm blue, but when you activate your function layer (to access media keys, for example), the lighting could automatically switch to red to give you a clear visual indicator that the layer is active.
Mastering QMK's lighting controls is the final step in creating a keyboard that is not just a tool, but a dynamic and personalized extension of your setup.
RGB_TOG
and brightness to a corner cluster so you can quickly dim lighting for video calls.This completes our journey through the world of backlighting! Next, we'll move on to the brain of the operation: Controllers.