krank56/bucklezig
Mechanical keyboard sound simulator with ultra-low latency (<10ms) - Built with Zig + Go
Mechanical Keyboard Sound Simulator for macOS
BuckleZig adds authentic mechanical keyboard sounds to any keyboard, giving your typing that satisfying click-clack feedback. Built with Zig for ultra-low latency audio (<10ms) and Go for a beautiful terminal UI.
🎹 BuckleZig - Mechanical Keyboard Sounds
┌───────────────────────────────────┐
│ Active Profile: Cream │
│ Volume: ████████░░ 80% │
│ Sounds Played: 1,234 │
└───────────────────────────────────┘
┌───────────────────────────────────┐
│ Profiles: │
│ │
│ Cardboard │
│ ▸ Cream [ACTIVE] │
│ Crystal Purple │
│ Japanese Black │
│ Milky Yellow │
│ Oreo │
└───────────────────────────────────┘
● Ready - Keyboard capture active!
j/k: Navigate • Enter: Select Profile • +/-: Volume • q: Quit
# Clone the repository
git clone https://github.com/yourusername/bucklezig.git
cd bucklezig
# Build the application
make build
# Run BuckleZig
./bucklezig
Audio profiles are not included in this repository due to licensing compatibility with GNU GPL. You must add them manually:
Create the profiles directory structure:
mkdir -p profiles/{Cream,Cardboard,"Crystal Purple","Japanese Black","Milky Yellow",Oreo}
Add your sound files:
1-down.wav
, 1-up.wav
, 2-down.wav
, 2-up.wav
, ..., 128-down.wav
, 128-up.wav
X-down.wav
= key press sound for keycode XX-up.wav
= key release sound for keycode XExample structure:
profiles/
├── Cream/
│ ├── 1-down.wav
│ ├── 1-up.wav
│ ├── 2-down.wav
│ └── ... (256 files total)
├── Cardboard/
└── ... (other profiles)
Where to get sounds:
Note: BuckleZig will not start without at least one complete profile directory.
Grant Accessibility Permissions (required for keyboard capture)
Start Typing!
Key | Action |
---|---|
j / ↓ |
Navigate down in profile list |
k / ↑ |
Navigate up in profile list |
Enter / Space |
Activate selected profile |
+ / ] |
Increase volume (10% increments) |
- / [ |
Decrease volume (10% increments) |
q / Ctrl+C |
Quit application |
j
or k
to navigate through the profile listEnter
to activate the selected profile+
to increase volume-
to decrease volumebucklezig/
├── zig/ # Zig audio engine (performance-critical)
│ ├── src/audio/ # Audio playback, WAV loader, mixer
│ ├── src/keyboard/ # System-wide keyboard capture
│ └── src/profile/ # Profile loading and management
├── go/ # Go TUI (user interface)
│ ├── cmd/bucklezig/ # Main entry point
│ └── internal/
│ ├── tui/ # BubbleTea interface
│ ├── bridge/ # CGO bridge to Zig
│ └── config/ # Configuration persistence
└── profiles/ # Sound profile WAV files
├── Cream/
├── Cardboard/
├── Crystal Purple/
├── Japanese Black/
├── Milky Yellow/
└── Oreo/
# Clean build artifacts
make clean
# Build everything (Zig library + Go app)
make build
# Run tests
cd zig && zig build test # Zig unit tests
cd go && go test ./... # Go unit tests
# Format code
zig fmt zig/src/**/*.zig # Zig formatting
cd go && gofmt -w . # Go formatting
BuckleZig uses a hybrid architecture:
See ARCHITECTURE.md for detailed technical documentation.
BuckleZig meets all its performance targets:
Metric | Target | Achieved | Status |
---|---|---|---|
Audio Latency | <10ms | ~7-9ms | ✅ |
Profile Switch | <200ms | Instant | ✅ |
Startup Time | <500ms | ~150ms | ✅ |
Memory Usage | <100MB | ~50-80MB | ✅ |
CPU Idle | <1% | <1% | ✅ |
+
to increase)ls -la profiles/
This means accessibility permissions aren't granted:
make clean && make build
See MANUAL_TEST.md for detailed troubleshooting.
Contributions are welcome! Please:
MIT License - See LICENSE file for details
Created by @krank56
Linux support (evdev keyboard capture)
Windows support
Custom profile creator
Per-key sound customization
Audio effects (reverb, EQ, compression)
Profile import/export
Community profile sharing
Made with ❤️ and Zig