Customization is often touted as the key advantage PCs have over consoles for gaming. Personalizing the user experience down to how your peripherals interact with the computer can deliver significant productivity gains. If you're using a mechanical keyboard or planning to build one yourself, the firmware flashed to the onboard MCU or dev board can help you wring the optimization out of your effort.
Firmware could be intimidating if you've never flashed a microcontroller before, but you only need to do it once if you get it right. Using open-source code built by fellow mechanical keyboard enthusiasts, you can rest assured you're picking a solution built around the specific needs, ranging from key assignment to support for wireless connectivity and rotary encoders. All that remains is picking the one that suits you best.
Identify your keyboard's microcontroller before experimenting with custom firmware. Most off-the-shelf keyboards aren't meant to be updated, and flashing incorrect or incompatible code on your dev board may brick it completely.
How to build your own mechanical keyboard
Want to build a mechanical keyboard from scratch? Check out our step-by-step guide to build the mechanical keyboard of your dreams.
5 Jetpacktuxedo firmware
The simplest solution for custom macropads
My first custom hand-wired mechanical keyboard project was a macropad, and is often the path requiring the least investment and appetite for risk. If you're building something similar, you'll appreciate the sheer simplicity of this custom firmware created by Redditor /u/jetpacktuxedo for their own custom gamepad. At one point, it had less than 100 lines of code in a single file. The code is now available on GitHub and can be adapted for any board wired in the standard row-column configuration.
However, there are limitations to consider as well. Macropads usually benefit from multiple functions programmed to each key in the matrix using layers. It works the same way. Uppercase and lowercase letters are layered with Shift serving as the layer toggle. This isn't supported on Jetpacktuxedo's firmware, and you can associate each key with a singular function. Depending on the size of your project, this may not even be a limitation. Just ensure you're using an Arduino, Leonardo, or Teensy development board as the brains of the project.
4 KMK Firmware
Built to stand out
Unlike most other firmware on this list, KMK stands out since it is coded in CircuitPython instead of C Language. Moreover, it's built specifically for wireless keyboard projects. It includes several extensions that can enhance the functionality of your keyboard. These extensions are modular because you can add or remove the board's features without forking existing code on GitHub. This repository is actively maintained, but the user-facing website isn't active at the time of writing.
That said, KMK isn't best suited for gamers and builds where input latency would be a concern. That's because CircuitPython usually taxes most MCUs, impacting speed. It is also notoriously memory-intensive, limiting the total number of features you can add to your keyboard's EEPROM.
3 TMK firmware
So many options with forks
TMK is one of the most balanced firmware options if you're building a split keyboard or something with dual controllers. Hasu originally created it as an alternative for the stock Happy Hacking Keyboard (HHKB) firmware, which is one of the most popular compact keyboards still produced today, even though the original wasn't mechanical.
Unlike Jetpacktuxedo's code, TMK is built in C, and it supports layers for multiple keybinds per key and per-key LED backlighting if you're brave enough to wire those to your board. The biggest USP of this firmware is the fidelity it brings to layout swaps. Research suggests QWERTY found on the vast majority of boards, may not be as efficient or comfortable as alternative layouts such as DVORAK and COLEMAK. With TMK on a split mechanical keyboard, you can easily switch layouts and figure out what works best for you. There's a web-based interface that takes the legwork out of configuring your keys and compiling the firmware too.
Such versatility has earned TMK its place on the /r/MechanicalKeyboards Wiki as well. The community has also forked the original code several times to create keyboard-specific versions you may find useful. Just be warned that it's easiest to run on Amtel AVR USB boards like the Planck, Ergodox, and HHKB it was created for. However, you might struggle to change parameters besides the layout, such as key hold delays.
Beginner’s guide to mechanical keyboards: Switches, keycaps, form-factors, and more
Ready to buy or build you new mechanical keyboard and enter the rabbit hole?
2 Zephyr Mechanical Keyboard (ZMK) firmware
Newest kid on the block
ZMK is one of the newest open-source firmware available for custom keyboard and macropad projects. As the name suggests, it is built on the Zephyr Project. It is designed with wireless keyboards and power efficiency in mind, and works with a plethora of microcontrollers, even if they are in split keyboard configuration (wired split boards aren't supported yet). Efficiency is so good that custom keyboard builders like Joe Scotto say a power switch is optional on boards running ZMK.
ZMK was created to give the community an open and future-proof platform with permissive MIT licensing, unlike GPL, which most others use. Even Zephyr itself uses the liberal Apache 2.0 open-source license. ZMK is functionally similar to our top firmware recommendation that follows, but interestingly, it doesn't share any source code with QMK either, thanks to licensing restrictions. The software is evolving rapidly, and a ZMK Studio web UI was recently added.
Since it is still in active development, it hasn't achieved feature parity with older repositories like QMK. So, you might need to wait for a few non-essential bits, like support for onboard OLEDs and real-time keymap updates. However, development has been rapid in the past couple of years, and the wait may not be long. You should note that unlike TMK, which was built for AVR, ZMK will not support AVR or 8-bit chips — only 32-bit and 64-bit platforms.
1 Quantum Mechanical Keyboard (QMK) firmware
The most versatile option out there
Of all the firmware choices available, QMK is by far the most widely available. You might have heard of QMK support on many mass-market mechanical keyboards like Keychron and Boardsource products, and with good reason. This firmware has been stable and steadily available for many years now, with plenty of maintainers adding new projects and features to the GitHub repository every month. The user-facing software is split into a configurator, a toolbox, and QMK command line interface installer called MSYS. The configurator is available as a web instance while the other two components are compatible with Windows and Mac.
Interestingly, QMK started life as a fork of the TMK firmware we mentioned earlier, and it now supports an assortment of microcontrollers, including AVR, ARM, RasPi, Arduino, and ESP32. Although command line-based, QMK has a dedicated web-based configurator GUI in which you can define the keymap for every layer before firmware is compiled. However, row and column mappings to the microcontroller data pins are housed in a separate config file that needs manual editing.
Perhaps the only disadvantage is that you must fork existing firmware before modding it and that you need to reflash the keyboard every time you make changes to the firmware, even for simple key reassignments. On the bright side, a couple of closed-source GUIs designed to address this concern earn them a mention on our list of otherwise open-source options.
VIA and VIAL
VIA was created by Olivia, who is also known for creating a keycap set named after herself with the famous brand GMK. This initiative's code isn't available to the public but is actively maintained. It offers real-time key reassignment and doesn't require firmware reflashes to commit the changes. Moreover, all QMK-compatible keyboards can work with VIA following a few firmware tweaks. You can even add VIA support to custom builds that are reliant on QMK.
VIAL resembles VIA in functionality, but is still in beta, and offers a few more features, such as better support for rotary encoder (knob) functions. However, I've sometimes had to re-flash my keyboards while using VIAL. You need to download the executable for Windows, macOS, and Linux, but all the documentation for porting is available online.
Building firmware shouldn't be complicated
While firmware is essentially just a few lines of code that translate inputs from your keyboards, macropads, and mice to your computer, they aren't always complicated to create. You can start off by forking a repository for one of the aforementioned open-source projects, or tinkering with the stock firmware that ships with your QMK-enabled board. For grassroots-level DIY, videos by YouTube creators Joe Scotto and MechMerlin are great guides to setting up firmware correctly.
That said, in the spirit of keeping open-source software enjoyable, accessible, and maintainable, we urge you to merge your changes to the official repository, or list your changes publicly as a fork. Such good practices keep the community thriving.
