How to Use Peaky 8-bit Repository / When you want customize key map
(日本語版は後ろにあります)
Peaky 8-bit (P8) uses ZMK for its firmware, and the repository is publicly available.
- Peaky 8-bit: https://github.com/toya-mimura/zmk-config-peaky8bit
When you receive your P8, it comes pre-flashed with the firmware version that I (toya, the developer) consider the best starting point for new users, with the keymap and key assignments set to that version.
As you use P8, you’ll likely want to customize the keymap to suit your needs. Follow the steps below when you’re ready to do that.
Cheat Code
In the age of AI, you don’t even need a guide like this. Just hand the repository URL above to an AI (Claude, ChatGPT, etc.) and ask:
How do I change the keymap?It’ll probably just tell you:
"Edit the CSV with your desired keymap, regenerate peaky8bit.keymap, and push!"You can also ask the AI to generate the .keymap file for you — it can run Python/uv on its end. That might be the fastest way.
When I want to change the keymap myself, I just tell Claude:
"Swap the N and H keys!"
(Edit the CSV and regenerate peaky8bit.keymap)
(Actually run `gen_keymap.py`)Then:
- Push the CSV and keymap that Claude generated to the repository
- Download the
.uf2(firmware) auto-built by Actions - Flash it to the MCU (Xiao BLE)
That’s literally my workflow.
The Big Picture
- Edit
docs/keymap_v04.csv - Run
gen_keymap.pyto regeneratepeaky8bit.keymap - Commit and push both files together
- GitHub Actions automatically builds the new firmware
- Download the
.uf2and flash it
That’s it.
IMPORTANTYou never edit the
.keymapfile directly.
Before You Start
Fork the repository to your own GitHub account.
- Actions run on your own fork.
Enable Actions
- If you know how, do it in advance.
- If not, Step 4 below walks you through it — skip this for now.
You’ll need a way to run Python: uv is the easiest.
- Alternatives: Google Colab, etc.
- Even easier: just ask an AI.
Step 1: Edit the CSV
Open docs/keymap_v04.csv. Each row corresponds to one chord code.

hex,layer1,with_shift,with_ctrl
0x11,write:a,write:A,keys:LCTRL+A
0x12,write:b,write:B,keys:LCTRL+BTo change a character, just find the row with that character and edit it. The hex column is the chord code ID — you can ignore it.
For example, to swap y and z:
- 0x2C,write:y,write:Y,keys:LCTRL+Y
- 0x2D,write:z,write:Z,keys:LCTRL+Z
+ 0x2C,write:z,write:Z,keys:LCTRL+Z
+ 0x2D,write:y,write:Y,keys:LCTRL+Y
The CSV has 4 columns, but the hex column is just the chord code ID — you can ignore it. You only need to edit the remaining 3 columns:
| Column | When it takes effect |
|---|---|
layer1 | Normal input |
with_shift | After arming Shift |
with_ctrl | After arming Ctrl |
NOTE“Arming” means pressing the modifier chord first (e.g. the “Ctrl +” chord), then pressing the character chord (e.g. the “A” chord) to produce
Ctrl + A. The combo inputs shown below are the modifier arm chords.

- Full keymap cheat sheet: https://github.com/toya-mimura/zmk-config-peaky8bit/blob/main/docs/images/P8-cheatSeat_v040_26-0723-black.png
Use a plain text editor to edit the CSV. Excel may silently reformat quotes and commas.
Step 2: Regenerate the Keymap
NOTEI always ask Claude to do this for me.
uv run docs/gen_keymap.py docs/keymap_v04.csv > boards/shields/peaky8bit/peaky8bit.keymapIf your host PC uses a Japanese keyboard layout (JIS):
uv run docs/gen_keymap.py docs/keymap_v04.csv --layout jis > boards/shields/peaky8bit/peaky8bit.keymapThe same CSV works for both layouts. The script handles the keycode differences.
Step 3: Push Both Files
NOTEI usually upload them manually through GitHub’s web interface.
git add docs/keymap_v04.csv boards/shields/peaky8bit/peaky8bit.keymap
git commit -m "swap y and z"
git pushYou need both the CSV and the .keymap. The build reads peaky8bit.keymap, so if you forget to include it, nothing will change.
Step 4: Download and Flash
After pushing in Step 3, go to the Actions tab. You’ll likely see a yellow banner or a warning message.
Click the button that says:
I understand my workflows, go ahead and enable themThis enables the repository’s build scripts to run automatically on GitHub. (Specifically: every time you push to this repository, Actions will run and build the firmware.)

- Open the Actions tab in your forked repository
- Wait for the build to finish (a few minutes), then download the artifact
- Click the Action run, scroll to the bottom, and find the download button in the “Artifacts” section

Next Step: Connect via USB and Flash the MCU (Xiao BLE)
After this, you’ll flash the .uf2 file to the Peaky 8-bit hardware using a USB Type-C cable. Details will be covered in a separate article. Here’s the general idea:
- Double-tap the XIAO’s RST button quickly to enter bootloader mode
- Drag and drop the
.uf2file onto the drive that appears
If Something Goes Wrong
Just revert and push again.
git revert HEAD
git pushOr grab a known-good .uf2 from Releases and flash that instead.
Want to Do More?
The CSV supports much more than just swapping characters — symbols, function keys, Bluetooth profile switching, multi-character snippets, and more. The format is documented in comments inside the script itself, so the quickest way is to feed docs/gen_keymap.py to an AI and ask: “What can I put in this CSV?”
Bonus
On the topic of “just ask an AI” — you can even ask it to build a typing practice app from the GitHub repository, and it’ll probably just work.
I had Claude build this typing practice app by:
- Handing it the GitHub repo and saying “build a typing app for this quirky keyboard”
- It was done in a single prompt.
- Bilingual support and minor tweaks took about 2 more prompts.
日本語版
Peaky 8-bit(P8)はZMKを利用してファームウェアを作成しており、そのリポジトリを公開しています。
- Peaky 8-bit: https://github.com/toya-mimura/zmk-config-peaky8bit
P8の入手時には、開発者(私、toya)が「今のところ、これが一番、初めて使う人にベスト」と考えたファームウェアのバージョンがMCU(Xiao BLE)に書き込まれており、キーマップ・キーアサインもそのバージョンになっています。
P8を利用していると、ご自身の都合に合わせてキーマップをカスタマイズしたくなってくると思います。 その際には下記の手順を参考にしてください。
チート情報
AIが普及した昨今では、このような手順書の記事がなくとも、上述のリポジトリのURLをAI(ClaudeやChatGPTなど)に渡して
キーマップの変更の仕方を教えて!と尋ねれば、あっさり
「CSVを希望するキーマップに書き換えてpeaky8bit.keymapを生成してPushするだけだよ!」と教えてくれると思います。
また、.keymapの生成も、AIに頼めばAI側でpython/uvを実行して生成してくれると思います。 それが一番早いかもしれません。
私もキーマップを変更したくなったときは、Claudeに
「NキーとHキーを入れ替えて!」
(CSVを書き換えて、peaky8bit.keymapを生成して)
(`gen_keymap.py`を実際に実行して)とお願いして、
- Claudeが作ってくれたCSVとkeymapをリポジトリにPushし、
- Actionsで自動生成されたuf2(ファームウェア)をDLして、
- MCU(Xiao BLE)に書き込んでいるだけ、
という感じで使っています。
ということで、大まかな流れの説明
docs/keymap_v04.csvを書き換えるgen_keymap.pyを実行してpeaky8bit.keymapを作り直す- 2つのファイルを一緒に commit して push
- GitHub Actions が自動で新しいファームウェアをビルド
.uf2をダウンロードして書き込む
これだけです。
IMPORTANT
.keymapファイルを直接編集することはありません。
始める前に
リポジトリを自分のアカウントに Fork してください。
- Actions は自分の Fork 上で動きます
Actionsを有効化する
- わかる人は事前に対応してください。
- 不明な人はこの後の「ステップ4」で解説があります、今は飛ばしてOK。
Python を動かす手段:uv が一番ラクです。
- その他手段:Google Colabなど
- もっと簡単:AIに頼む。
ステップ1:CSVを編集する
docs/keymap_v04.csv を開きます。 1行が1つのコードに対応しています。

hex,layer1,with_shift,with_ctrl
0x11,write:a,write:A,keys:LCTRL+A
0x12,write:b,write:B,keys:LCTRL+B文字を変えたいときは、その文字が書かれている行を探して書き換えるだけです。 hex 列はコードのIDなので、気にしなくて構いません。
たとえば y と z を入れ替えるなら:
- 0x2C,write:y,write:Y,keys:LCTRL+Y
- 0x2D,write:z,write:Z,keys:LCTRL+Z
+ 0x2C,write:z,write:Z,keys:LCTRL+Z
+ 0x2D,write:y,write:Y,keys:LCTRL+Y
CSVには4列ありますが、hex 列はコードのIDなので気にしなくてOK。 書き換えるのは残りの3列です。
| 列 | いつ効くか |
|---|---|
layer1 | 通常の入力 |
with_shift | Shift を arm した後 |
with_ctrl | Ctrl を arm した後 |
NOTE「armする」=「Ctrl + A」などしたいときに「Ctrl +」のキーマップを先に押す(その後Aのアサインを押下)、という動作のことです 下図のコンボ入力が該当します

- キーマップのチートシート全体:https://github.com/toya-mimura/zmk-config-peaky8bit/blob/main/docs/images/P8-cheatSeat_v040_26-0723-black.png
編集は テキストエディタ を強く推奨します。 Excel で開くとクォートやカンマを勝手に整形されることがあります。
ステップ2:生成し直す
NOTE私はいつもClaudeに頼んでいます。
uv run docs/gen_keymap.py docs/keymap_v04.csv > boards/shields/peaky8bit/peaky8bit.keymapPC側が日本語配列(JIS)の場合:
uv run docs/gen_keymap.py docs/keymap_v04.csv --layout jis > boards/shields/peaky8bit/peaky8bit.keymapCSV はどちらでも同じものを使います。 キーコードの違いはスクリプト側で吸収されます。
ステップ3:2つのファイルを push
NOTE私はいつもブラウザ版のGitHubのリポジトリに手動でアップロードしています。
git add docs/keymap_v04.csv boards/shields/peaky8bit/peaky8bit.keymap
git commit -m "swap y and z"
git pushCSVと.keymapの両方が「必要」です。 ビルドが読むのは peaky8bit.keymap の方なので、これを入れ忘れると何も変わりません。
ステップ4:ダウンロードして書き込む
ここで、前述の「ステップ3」を実行し、Actionsタブに移動すると、黄色いバナーが出ているか、警告コメントのようなものが出ると思います。
I understand my workflows, go ahead and enable themと書かれたボタンを押してください。 すると、自動でリポジトリ内のスクリプトが、GitHub上で実行されるようになります。 (具体的には:このリポジトリにPushが走ると、都度Actionsが実行され、以下の挙動が走ります)

- Fork した自分のリポジトリの Actions タブを開く
- ビルド完了を待って(数分)、成果物をダウンロード
- 実行したActionをクリック ⇒ 一番下に行く ⇒ “Artifacts”内にDLボタンがある

次のステップ:MCU(Xiao BLE)にUSB接続して書き込む
このあと、USB Type-Cを利用してPeaky 8-bit本体に入手した.uf2を書き込みます。 こちらは次の記事にて詳細を説明します。 大方の流れとしてはこんな感じになります。
- XIAO の RST を素早く2回タップしてブートローダーモードに入る
- 出てきたドライブに
.uf2をドラッグ&ドロップ
うまくいかないとき
戻して push し直せば大丈夫です。
git revert HEAD
git pushまたは Releases から動いていた .uf2 を取ってきて書き戻してください。
もっと凝ったことをしたい人へ
CSV では文字の入れ替え以外にも、記号・ファンクションキー・Bluetoothプロファイル切り替え・複数文字のスニペットなど、いろいろ書けます。 書式はスクリプト自体にコメントとして書いてあるので、docs/gen_keymap.py を AI に読ませて「このCSVには何が書ける?」と聞くのが手っ取り早いです。
おまけ
「AIにお願いする」という点で、例えば「タイピングアプリを作って」というのもGitHubリポジトリをAIに渡せば簡単にできてしまうと思います。 私もこちらのタイピング練習用アプリを、
- GitHubリポジトリを伝えて「このちょっと変わったキーボード用のタイピングアプリを作って欲しい」と頼む
- シングルプロンプトでできてしまった。
- 2言語対応や細かい部分の微修正を依頼するのに2プロンプトほど追加
という感じでClaudeに作ってもらえました。