Skip to content
Embarrassingly templated keyboard framework
C C++ CMake Python
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
cmake Slightly more sane build system Apr 12, 2017
include Improve configuration Apr 24, 2017
keyboards Improve configuration Apr 24, 2017
src Improve configuration Apr 24, 2017
tools Add add_new_keyboard tool Apr 12, 2017
.gitignore Add autosaves to gitignore Apr 6, 2017
CMakeLists.txt More build options Apr 13, 2017
LICENSE Initial commit Mar 29, 2017 Update toolchain build instructions Mar 10, 2018


Embarrassingly templated keyboard framework

The aim of this is to have very terse descriptions of keyboards and give good compile-time diagnostics when mistaeks are made. Here's the entire configuration file for a simple 40% Dvorak keyboard:

#include "keys.hpp"
#include "type.hpp"

using namespace etkf;
using namespace etkf::pins;

struct test_keyboard {
    using rows = pin_set<b4, b6, f1, f0>;
    using columns = pin_set<f6, f7, c7, c6, d3, d2, d1, d0, b7, b3, b2, b1, b0>;

    static auto layouts();

    using key_positions = typelist<


using keyboard_to_run = test_keyboard;

auto test_keyboard::layouts() {
    using namespace etkf::keys;

    return typelist<
            row<tab, quot,comm,dot, p,   y,   f,   g,   c,   r,   l,   bspc, null>,
            row<lctl,a,   o,   e,   u,   i,   d,   h,   t,   n,   s,   ent>,
            row<lsft,scln,q,   j,   k,   x,   b,   m,   w,   v,   z,   del>,
            row<caps,lgui,esc,lalt, spc,      null,null,left,down,up,  righ>

Currently it has only been tested on Linux, but I guess it could work elsewhere if you can get the toolchain set up.

How to build:

mkdir build
cd build
cmake -DKEYBOARD_TO_BUILD=<keyboard name> ..

How to add a new keyboard:

There is a Python script which will do all of the legwork for you:

tools/ <keyboard name>

Current state:

  • A configuration like the above will allow you to type things!
  • Supports Teensy 2 (ATMEGA32U4)
  • 6 key rollover
  • Modifier keys
  • Basic layer support
  • Change default layer (e.g. QWERTY to Dvorak)

To do:

  • Debouncing
  • NKRO
  • Better compile-time diagnostics
  • Debugging support
  • Rewrite of the USB code
  • Support more chips
  • Port some keyboards
  • Profile-driven optimisations


  • C++17 AVR compiler (you can build one by following these instructions)
  • CMake
  • Hardware to run it on
  • Nachos (optional)
You can’t perform that action at this time.