Skip to content
AVR keyboard firmware with PS/2 trackpoint support & macro mode.
C C++ Shell OpenSCAD Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
LUFA @ 52a5016


This is a firmware for AVR microcontrollers with USB device support like the Teensy to simulate a keyboard and a mouse. It was created for a custom split keyboard design with 4x6 keys on each side in a matrix layout but could be adapted easily for other hardware.

By default, it implements a different, more ergonomic layout without any further drivers on any host operating system. In its current state, the well evolved AdNW layout is implemented with modified layers 3&4 (special characters, navigational keys and numpad) from the neo layout. In addition, an integrated IBM trackpoint is also supported, but any PS/2 compatible device can also be hooked-up to the controller.

BlueCube HyperNano

This is my daily driver since about 2 years now: RedTilt

A presentation of my current keyboard prototype can be found here, where you'll also find more detailed information on the hardware and the layout used as well as discussions related to these project.


  • Full macro support with all configuration done on the keyboard itself, no external tools needed.
  • 2nd-Use modifier keys acting as normal keys when toggled by themselves.
  • PS/2 protocol for pointing devices
  • Mouse device with 3 buttons and 2 scrollwheels
  • IBM trackpoint configuration
  • Supports multiple layouts in switchable layers
  • Native support for different host keyboard language settings, qwertz and qwerty implemented
  • HMAC-SHA1 based string generatiom for safer passwords


The driver was originally based on humblehackers hhkb firmware, but I found some things (while pretty neat and cleanly implemented) a little too difficult to adjust, so I revamped everything but the most basic USB code.

Implementation of mousekey layer, KEYMAP macro and other neat ideas borrowed from the very advanced tmk_firmware.

Klaus Weber contributed greatly to an enhanced secondary use state machine and provided several other modifications, including alternate layouts as well as PC/Mac and host language differentiations.

PS/2 support is credited in large part to Akshay Srinivasan

A dedicated USB ID was generously supplied by Openmoko, Inc.

Password hash generation is implemented after the algorithm from the Android apps Twik (python implementation here) and HashIt!, which in turn are based on the chrome extension Password Hasher Plus.

It uses hmac-sha1 and sha1 implementations from avr-crypto-lib, licensed under GPL3.


Unless otherwise mentioned all code is licensed under GPL3.

If you create a firmware from this code you must change the vendor and product id!


You will need a recent version of the LUFA usb stack to compile this software. If you want scrollwheel support for the mouse, the included patch needs to be applied. From this root directory, execute

$ git submodule init
$ git submodule update

To build, please adjust controller type and build switches in makefile. The hardware wiring needs to be specified in matrix.h . Further configuration can be achieved by editing src/config.h .

Valid ids can be retrieved from AVR demoes, or the keyboard examples of the LUFA lib.

Then simply call

$ make

Current Layout

Current default layout as implemented in keymap.h : ( discussion at deskthority and as a graphical layout )


Thumb keys & modifiers
                        Macro    TP
                        -        -
LShft LAlt LCtrl Space                  Mod1 Mod3 AltGr Fx
 -     Esc  Tab  Space                  BkSp Ret  -     -
                        LWin     Mod2
                        -        -
Layer 0 & Mod1 ( letters shifted)
K  U  Q  .: J     P  C  L  M  F
H  I  E  A  O     D  T  R  N  S
X  Y  -_ ,; /     B  G  W  V  Z
M2 / special
@  °  [  ]  #     !  <  >  =  &
\  /  {  }  *     ?  (  )  +  :
   $  |  ~  `     ^  %  "  '
M3 / MoveNum
PgUp BkSp  Up  Del  PgDo   ß 7 8 9 ä Ä
Pos1 Left Down Righ End    . 4 5 6 ö Ö
Esc  Tab  Ins  Ret  Undo   0 1 2 3 ü Ü
tbd, see keymap.h
You can’t perform that action at this time.