Happy Hacking layout on a Keychron Q60 (wired, QMK / VIA)
Interactive guide
hhkb_q60.py remaps a regular wired Keychron Q60 (USB 3434:01C0) to the HHKB Professional layout. It writes the keymap over the VIA raw-HID protocol, the same way usevia.app does. That means:
Python 3 on Linux. No extra packages.
The Q60 is already physically an HHKB layout. The script changes three things:
| Group | Keys |
|---|---|
| Arrows and paging | Fn + [ ↑ · / ↓ · ; ← · ' → · K Home · , End · L PgUp · . PgDn |
| Editing | BS Backspace · Fn + BS Delete · Fn + ` Delete · Fn + \\ Insert · Fn + Tab Caps Lock |
| Function row | Fn + 1…0 F1–F10 · - F11 · = F12 |
| Media | Fn + A Vol − · S Vol + · D Mute · F Eject (macOS) |
| Numpad | Fn + H * · J / · N + · M − · Enter Numpad Enter |
| System | Fn + I PrtSc · O ScrLk · P Pause · Esc Power |
| Key | Up | Key | Down |
|---|---|---|---|
| Tab | Backlight on / off | ||
| Q | Next effect | A | Previous effect |
| W | Brighter | S | Dimmer |
| E | Hue forward | D | Hue back |
| R | More saturation | F | Less saturation |
| T | Faster effect | G | Slower effect |
| N | NKRO on / off |
The slide switch on the side picks the base layer. Only the bottom row differs.
| Position | Bottom row |
|---|---|
| Mac (layer 0) | Option Cmd Space Cmd Option |
| Windows (layer 1) | Win Alt Space Alt Win |
1. Allow access to the keyboard. On Linux, only root can write to the keyboard’s VIA interface by default. To allow it until you unplug the keyboard (the hidraw number can vary; the script prints the right one if access fails):
sudo chmod a+rw /dev/hidraw9
To allow it permanently, which also lets usevia.app connect in Chrome:
echo 'KERNEL=="hidraw*", ATTRS{idVendor}=="3434", ATTRS{idProduct}=="01c0", MODE="0660", TAG+="uaccess"' \
| sudo tee /etc/udev/rules.d/99-keychron-q60.rules
sudo udevadm control --reload && sudo udevadm trigger
2. Run the script.
python3 hhkb_q60.py backup # save every layer to q60_backup_<timestamp>.json
python3 hhkb_q60.py apply # back up, write the HHKB layout, read it back to verify
python3 hhkb_q60.py restore FILE.json # write a backup back to the keyboard
apply always saves a backup first. To undo the change, restore the backup it made.
3. Fine-tune in VIA (optional). Open usevia.app in Chrome or Chromium and authorize the Q60. VIA’s layers line up with this layout:
| VIA layer | Use |
|---|---|
| 0 | Mac |
| 1 | Windows |
| 2 | Fn |
| 3 | Fn + Right Shift |
| 4, 5 | Empty, free for your own keys |
| File | What it is |
|---|---|
hhkb_q60.py |
The remapping script |
q60-hhkb-guide.html |
Interactive version of this guide, also served on GitHub Pages |
assets/ |
Images used in this README |