Design your own fight stick or leverless controller, in your browser
Advanced
Or see every lesson.
- 261parts on the bench
- 31boards running now
- 1.00xreal time, on every board
Every custom controller starts the same way: a layout sketched on paper, a pin map in a notes app, and a lot of hoping it all works once the case is drilled. Mokxi lets you template the whole build first. Lay out the buttons, wire them to a Raspberry Pi Pico, run firmware that does what a modern controller board does, and play it with your keyboard. When it works here, you wire the real thing to the same pins.
The controller above is the leverless template, running. Press Run, then hold A and D together and watch SOCD cleaning decide what the game would get. W is up, U I O P and J K L ; are the eight attack buttons, Q E H are Select, Start and Home, and T is turbo. The OLED shows your inputs as you press them, and every lit button reacts to a press.
There are three templates on the same board and the same firmware: a leverless (all-button) layout, a traditional stick with a Sanwa-style lever, and a mixbox-style layout with W A S D under the left hand. Open one, make it yours, and save it to your account.
What you need
- Raspberry Pi Pico
- 4 direction buttons (24 mm for left, down and right, 30 mm for up), or a lever, or 4 keyboard switches
- 8 LED arcade buttons, 30 mm
- 4 function buttons, 24 mm: Select, Start, Home and turbo
- SSD1306 128 x 64 I2C OLED
- Wire for a ground chain and one signal wire per button
Wiring
| Part and pin | Goes to | Note |
|---|---|---|
| Up | GP2 | GP2040-CE default |
| Down | GP3 | GP2040-CE default |
| Right | GP4 | GP2040-CE default |
| Left | GP5 | GP2040-CE default |
| LK (B1) | GP6 | bottom row |
| MK (B2) | GP7 | bottom row |
| HK (R2) | GP8 | bottom row |
| 3K (L2) | GP9 | bottom row |
| LP (B3) | GP10 | top row |
| MP (B4) | GP11 | top row |
| HP (R1) | GP12 | top row |
| 3P (L1) | GP13 | top row |
| Turbo | GP14 | GP2040-CE default |
| Select (S1) | GP16 | GP2040-CE default |
| Start (S2) | GP17 | GP2040-CE default |
| Home (A1) | GP20 | GP2040-CE default |
| OLED SDA and SCL | GP0 and GP1 | GP2040-CE default display pins; VCC to 3V3 |
| Lamps, top row | GP18, GP19, GP21, GP22 | one PWM pin per lamp |
| Lamps, bottom row | GP15, GP26, GP27, GP28 | one PWM pin per lamp |
| Every switch and lamp, other leg | GND | one ground chain |
Want the step-by-step version? The lesson "Build your own fight stick, lesson 1: one button" walks through this with checkpoints.
Open the lessonTemplate your build, test it, then wire the real thing
Each template is laid out like the controller it is: the left-hand cluster or the lever on the left, two staggered rows of attack buttons on the right, the function buttons along the top and the Pico in the middle. Every button is wired the way a case is wired, one wire to its pin and a ground chain from button to button, so the drawing doubles as your wiring plan.
Move a button and its wire moves with it. Every arcade button has a size (30 or 24 mm), a cap color, a label printed on the cap and a keyboard key in its properties, so you can lay out your own panel, name the buttons for your game and play it with several buttons held at once. The project page lists every connection pin by pin, ready to print and keep beside the soldering iron.
Firmware that does what a controller board does
The templates run one firmware, written for the Pico and commented for people who build controllers. Everything you are likely to change sits in a single block at the top: the layout, the pin map, the button names, the lights, the starting SOCD rule and the timing.
Debounce adds no lag: a press counts the moment its first edge arrives, and the pin is then ignored for 5 milliseconds so the contact bounce is thrown away. SOCD cleaning offers Neutral, Up priority, Last win and First win. D-pad, left stick and right stick modes are there too, and both switch with GP2040-CE’s own button combos, with nothing reaching the game while a combo is held. Turbo is per button. The lit buttons have themes and a press fade, and the OLED input display draws your inputs and an input history in numpad notation without ever making a press wait for the screen.
The Serial Monitor is an input viewer: one line for every change in what the controller would send, with the direction in numpad notation, the buttons held, and how many 60 Hz frames the previous state lasted.
The pin map is GP2040-CE’s
GP2040-CE is the open-source gamepad firmware most DIY Pico builds run. The templates use its default pin map for a bare Pico, taken from the project’s own board configuration: Up on GP2, Down on GP3, Right on GP4, Left on GP5, the eight attack buttons on GP6 to GP13, turbo on GP14, Select and Start on GP16 and GP17, Home on GP20, and the OLED on GP0 and GP1. So a build you prove here can be flashed with GP2040-CE on the bench and wired exactly the same, or run firmware of your own if you would rather write it.
Two things differ from GP2040-CE, and the sketch says so. GP2040-CE lights buttons with a chain of WS2812 RGB LEDs on one pin, timed by the RP2040’s PIO block, which Mokxi does not simulate, so the templates use LED arcade buttons with a lamp per pin instead. And Mokxi does not simulate the Pico’s USB, so each report the controller would send is a line on the Serial Monitor rather than a gamepad on your PC.
SOCD rules, and which events want which
A lever’s gate cannot point left and right at once, but four buttons can be held in any combination. SOCD cleaning decides what the controller sends then. Neutral sends neither direction. Up priority, the classic Hit Box rule, sends neither for left plus right and up for up plus down. Last win lets the newer press win, and First win the older one.
Evo’s rules ask that a controller never sends opposite directions together, and name Neutral, First input priority and Last input priority as accepted methods. The Capcom Pro Tour rule for Street Fighter 6, announced in 2023, says up plus down must give neither a jump nor a crouch and left plus right neither walk, which Neutral meets and Up priority does not. Rules change by event and by game, so check the current ruleset of the event you play. The templates start in Neutral.
Consoles, PCs and authentication
On the bench, GP2040-CE can present a Pico as an XInput controller for PC, a Nintendo Switch controller, a PS3 or DirectInput controller and more, picked by holding a button as you plug it in. PlayStation 4 and 5 consoles only accept controllers that pass an authentication check, which ready-made boards such as Brook’s handle with a licensed chip. GP2040-CE’s documentation explains its own options for that and says it will not provide authentication files. Mokxi does not simulate USB at all, so none of this is something the simulator can test: what you prove here is everything before the USB cable.
New to this? Take the course
Build your own fight stick is a free five-lesson course that builds the leverless template a stage at a time on the same pins: one button and a lag-free debounce, the four directions with SOCD cleaning, all eight attack buttons, lit buttons with themes, and finally the full controller with its screen, mode combos and turbo. Every step is a checkpoint the simulator checks for you.
Questions
Can I design a leverless or Hit Box style controller here?
Yes. Open the leverless template, move the buttons, rename them, change their size and color, and save it as your own project. The firmware and the wiring follow your changes.
Does Mokxi run GP2040-CE?
No. Mokxi runs Arduino-style sketches. The templates use GP2040-CE’s default Pico pin map and its button combos, so the wiring you prove here works with GP2040-CE when you flash a real board.
Which SOCD mode should I use?
Check the rules of the event you play. Neutral is accepted under Evo’s rules and meets the Capcom Pro Tour rule for Street Fighter 6, which is why the templates start in it.
Do I need an account?
No account is needed to open, run and change a template. Sign up free to save your own build and come back to it.
Keep going
Where the facts on this page come from
Build this for real
Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.