I have a ThinkPad x230 with Sound (mute/unmute), Volume, Microphone (mute/unmute) and Lock Screen physical keys. The Microphone key does not work out-of-the-box, and I finally decided to search a bit for a solution. I found this nice post about Ubuntu.
So, I decided to give it a try.
Following the instructions, first run:
and press the Microphone key. It displayed this output:
button/f20 F20 00000080 00000000 K
which resulted in:
Simple mixer control 'Master',0 Simple mixer control 'Capture',0
What I need is the second line in order to bind the Microphone key to the mute/unmute event. As suggested in the original post, I created an ACPI event file
event=button/f20 F20 00000080 00000000 K action=/usr/bin/amixer sset 'Capture',0 toggle
acpid did not seem to have an effect:
Hmmm… Is it because of PulseAudio? I had to reboot the system for the button to start working. Even then, it sometimes behaved funny. For instance, I needed to press the Sound button couple of times before the Microphone button started working. Now it seems to work fine. I will search for a better solution, but for now this should do.