afterware
Resources
Saved
1/6
Hardware · build

A smackable duck that fires PC macros

Original

A blocky yellow duck with a tactile switch under its head. Smack it once, twice or hold it, and it fires a different keyboard shortcut depending on which app has focus.

Build sheet
Controller
XIAO ESP32-C3
Input
Miniature tactile switch
Body
3D-printed PLA
Software
Arduino firmware + Python app
Can I build this?Intermediate · AI 4/5 · $8–20
Difficulty
Intermediate
AI-buildability
4/5

The firmware and the Python focus-aware macro app are easy for AI to write, while the two-wire soldering, 3D printing and sponge-and-plunger assembly are light hands-on work.

Time
A weekend
Cost
$8–20
Tools
soldering iron3D printersupergluedouble-sided tape
Starter prompt

Based on "A smackable duck that fires PC macros" on Afterware: https://afterware.xyz/p/a-smackable-duck-that-fires-pc-macros

Write Arduino firmware for a Seeed XIAO ESP32-C3 wired to a momentary tactile button on GPIO 4 and GND. Debounce the switch and classify presses as single tap, double tap or long hold, sending TAP_1, TAP_2 or TAP_HOLD over USB serial. Then write a Python app on Windows that reads those serial messages and sends a keyboard shortcut based on the focused window.

Estimates based on the original write-up. How AI-buildability is scored. Building with an AI assistant? Connect it to Afterware (free MCP server).

Story

The trick is the sponge. A miniature tactile switch has about 0.25 mm of travel, so the build wedges a 2 cm square of kitchen sponge between the head and the button. Off-center smacks stop tilting the head or jamming the plunger, and every hit gets a snappy rebound.

Inside, a Seeed XIAO ESP32-C3 sits on double-sided tape with two wires soldered to GND and GPIO 4. The firmware debounces the switch and times the hit: a single smack, a double smack or a long hold goes over USB as TAP_1, TAP_2 or TAP_HOLD. A Python companion app on the PC checks the focused window and fires the shortcut mapped to that program, so the same smack can play or pause Spotify, delete a word in Word or minimize Chrome.

Worth stealing: the parts are small, blocky and printable without supports in PLA, and the firmware flashes from a browser with no IDE. Swap in any tactile switch and the same sponge-and-plunger trick works for any soft-button enclosure.

Resources · 4
More like this
More like this