Skip to content
WiltzsuPublic

About

Mechanical keyboard sounds for Linux: per-key Mechvibes packs via evdev + miniaudio, in C.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keysound

Play a click sound on keyboard key presses (Linux evdev + miniaudio).

Requirements

  • Linux with evdev (/dev/input/event*)
  • Build: gcc, libpulse-dev (PipeWire/PulseAudio playback)
  • User in the input group (log out/in after sudo usermod -aG input "$USER")

Setup

curl -fsSL -o miniaudio.h \
  https://raw.githubusercontent.com/mackron/miniaudio/master/miniaudio.h

mkdir -p ~/.local/share/keysound/soundpack
# Put the Mechvibes pack files there (concatenated_audio.wav + config.json).

The per-key timings in keymap.c match one specific pack (its config.json). A different pack needs a regenerated table.

Build

gcc -Wall -Wextra -o keysound keysound.c keymap.c -lpthread -ldl -lm -lpulse

Run

./keysound [-d soundpack_dir] /dev/input/eventN

-d sets the folder that holds concatenated_audio.wav (default: ~/.local/share/keysound/soundpack).

Find the device: sudo apt install evtest && sudo evtest - pick your keyboard.

keyd: if the physical keyboard is grabbed, use the keyd virtual keyboard node instead (often /dev/input/event11). Check with evtest.

Do not run with sudo - audio goes to your user session.

Notes

  • keysound.c enables miniaudio's PulseAudio backend so audio routes to normal desktop output (not silent HDMI ALSA).
  • Sound packs from mechvibes.com are third-party; keep them out of git.

License

MIT

About

Mechanical keyboard sounds for Linux: per-key Mechvibes packs via evdev + miniaudio, in C.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages