I was having this problem in Linux Mint 18.1
with a fresh install. It was especially a problem controlling Banshee
media player with my media keys. As others have stated, the volume and mute keys worked but not the keys for forward and back media key commands. Trying to manually assign key commands by creating new shortcuts and so forth didn't work either.
But I figured out what the problem was and solved the problem I was having, and this may work for some others as well.
First: Delete any custom shortcuts you have created for your media keys within your keyboard settings. (You're going to want to reassign everything after subsequent steps to be sure everything "takes")
Second: CHECK THE SETTINGS OF THE "SOUND" APPLET!
This is important because, for me, THE SOUND APPLET
WAS THE PROBLEM! I found that if I was running Banshee and left-clicked on the sound applet so it popped up, and then hovered my mouse over the popup, that I could use my media keys as I had assigned them. This is, of course, inconvenient because you have to keep your mouse in one place on the screen, hovering over the sound applet's popup--massively impractical.
SO: Go to the panel
where your sound applet
is located and right click it
. Select "configure"
and look over your settings. For me, "Control Players"
was toggled on. I toggled it off after deleting my custom keyboard shortcuts, then I toggled it back on and re-entered custom keyboard shortcuts for banshee (banshee --next and banshee --previous and assigned the keys by pressing them etc again). After you've made the changes by toggling off "Control Players"
and deleting the custom shortcuts, it may be a good idea to restart your computer--I did, just to be sure the change "took". Then when I re-assigned those keys back as custom shortcuts and toggled "Control Players"
back on after the computer restarted, I restarted again after toggling "Control Players"
back on and assigning the custom shortcuts again--this is just to be sure that cinnamon and all the applets etc are refreshed with the new settings (this may not be necessary, but I do it this way anyway, because I'm kinda old school and wanted to eliminate not having refreshed everything as a possible cause for why I wasn't getting the result I wanted after changing things)
I opened banshee up again and tried it and it has been working fine. I can control it using the media keys without having to have my mouse pointer hovering over the opened popup of the sound applet.
One thing though, you may need to toggle the "Control Players"
setting in the sound applet
on and off a time or two. Especially if you (as I was doing the first time I did this on one of my computers) are trying to do this without restarting and with the media player running etc as you are making changes, because you're trying to isolate what the problem is and want to be able to try and retry the keys between changes.
Again, though, I've only tried this for Banshee since it was the only program I was having this issue with and is the main media player I use. I'm not sure if this will work for other programs, but it's worth trying--I don't see why it wouldn't work since the process of assigning a custom shortcut etc should be the same for any other program as it is for banshee.
As to things others have said about Google Chrome sort of hijacking the keys etc, I have not had that issue happen to me, but I am wondering if that isn't related to this issue with the sound applet
as well. It may be that the Chrome hijacking problem goes away once the sound applet
is bound to the custom shortcuts for your media keys? If you are having that problem, you could try this trick of toggling "Control Players"
off (if it's set to on) then deleting your custom shortcuts, and toggling back on and re-assigning the shortcuts again etc. and see if getting the key bindings to stick to the applet prevents Chrome from hijacking your players, too. I'm curious about if this will help for that problem, too. I've never had that issue with Chrome so I wouldn't even know how to test it, since I'm not sure why it's happening for some people and not for others.