How to get audible feedback ("Thunk" sound, no typewriter) when pressing a keyboard key?

Solution 1:

In Ubuntu 17.04 (or newer, I suppose) one can install with sudo apt-get install bucklespring, which will do what I think you want. Once installed, it can be started by simply executing buckle and stopped by Ctrl+C.

If you're on an older Ubuntu, you can try to install bucklespring from this PPA: https://launchpad.net/~mirabilos/+archive/ubuntu/ppa .

If the default sound recordings of IBM Model M are not suitable, you can replace them with your own. You can have a different sound for each key, but assuming you have only one sound, you need to make a few links to it, so that bucklespring will use it correctly. Assuming your sound file is called sound.wav:

cp -av /usr/share/buckle/wav my-sounds
cd my-sounds
for fname in ??-?.wav ; do ln -sfv ../sound.wav "${fname}" ; done
cd ..
buckle -p my-sounds

(If the delay between the keypress and the sound is too long for your needs, bucklespring seems to support jack, which supposedly introduces less latencies.)