When USB keyboard is connected all media stops playing randomly?

Solution 1:

One or more multimedia keys may be faulty and trigger itself with no reason. I would suspect STOP, PAUSE or PLAY / PAUSE.

(I assume you use Ubuntu with Xserver.) To confirm my guess install xinput first:

sudo apt-get update && sudo apt-get install xinput

Then run xinput list and find your problematic keyboard id. Next invoke:

xinput test id

(replace id with the actual number).

Press STOP, PAUSE or/and PLAY / PAUSE and write down their numbers displayed by xinput.

In my case id is 16, PLAY / PAUSE reports as 172 and STOP as 174 (there is no separate PAUSE on my keyboard). If I had your problem, I would test it like this:

xinput test 16 | grep -E '172|174'

Invoke similar command (with your numbers) in your console and let it run. Play multimedia but don't touch multimedia keys. You can work with other windows. When the problem reappears, check if there was a keystroke registered by xinput.


If faulty key is really the cause, you can disassemble your keyboard and try to clean the switch under the button.


In case you need to disable e.g. STOP in Ubuntu:

xmodmap -e 'keycode 174 = NoSymbol'

(xmodmap is in the x11-xserver-utils package). Replace 174 with another number to disable another key. (Source.)

Unfortunately I don't know (yet) Windows way to disable a key.