Media keyboard shortcuts not working

Bug #1302885 reported by Ivan on 2014-04-04
286
This bug affects 61 people
Affects Status Importance Assigned to Milestone
Unity
Fix Released
Medium
Iain Lane
7.2
Fix Released
Medium
Iain Lane
unity (Ubuntu)
Medium
Iain Lane
Trusty
Undecided
Unassigned

Bug Description

I can map the Volume Control keys in Keyboard Shortcuts e.g. Volume up/down to Volume up/down, but when I press the Volume keys on the keyboard nothing happens.

I have noticed the same problem with other keys on my Logitech Internet 350 keyboard with Tools, Mail, and HomePage.
They can all be mapped with Keyboard Shortcuts, but nothing happens afterwards when the keyboard key is pressed.

All these keyboard settings worked fine in older versions of Ubuntu.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: unity-control-center 14.04.3+14.04.20140328-0ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-22.44-generic 3.13.8
Uname: Linux 3.13.0-22-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Apr 4 23:49:58 2014
ExecutablePath: /usr/bin/unity-control-center
InstallationDate: Installed on 2014-04-02 (2 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Daily amd64 (20140402)
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: unity-control-center
UpgradeStatus: No upgrade log present (probably fresh install)
usr_lib_unity-control-center:
 activity-log-manager 0.9.7-0ubuntu12
 deja-dup 30.0-0ubuntu4

Related branches

Ivan (quids) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unity-control-center (Ubuntu):
status: New → Confirmed
Espen Meidell (espen-meidell) wrote :

This bug affects me as well. Neither volume combination on laptop (FN+PgUp/Down) nor media keys and launcher keys on usb keyboard work. Other shortcuts sutch as Super+W and open terminal (Ctrl+Alt+T) work just fine.

Daniel Serpell (daniel-serpell) wrote :

The problem is that an incorrect string is set in dconf key:

Original (working) value:
~$ gsettings get org.gnome.settings-daemon.plugins.media-keys volume-up
'XF86AudioRaiseVolume'

After running "unity-control-center keyboard", and setting the shortcut for
volume-up key:
~$ gsettings get org.gnome.settings-daemon.plugins.media-keys volume-up
'AudioRaiseVolume'

The new value misses the "XF86" part of the string, and does not work.

You can get the key working again by resetting the value, with:
~$ gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-up

Espen Meidell (espen-meidell) wrote :

Confirming that Daniels solution works for media keys. It also works for i.e. email

Thanks Daniel Serpell.

but add the bellow command to resetting the volume-down too:

~$ gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-down

gugaiz (gugaiz) wrote :

I had the same problem but with next and previous multimedia keys, I run

~$ gsettings reset org.gnome.settings-daemon.plugins.media-keys next
~$ gsettings reset org.gnome.settings-daemon.plugins.media-keys previous

and start working again.

Andriy Petruk (trabo) wrote :

It cab be also fixed with GUI dconf-editor by editing or setting default values in "org.gnome.settings-daemon.plugins.media-keys"

Marco Russo (russomarco) wrote :

My media keys were already set to default, so the solution from comment #4 didn't work for me. What salved the problem for me was adding the official gnome3 ppa and upgrading gnome:

~$ sudo add-apt-repository ppa:gnome3-team/gnome3
~$ sudo apt-get update && sudo apt-get dist-upgrade

After reboot everything worked. Hope this helps!

Simplet (simplet) wrote :

Ubuntu 14.04 fresh install here and same problem.
Daniel's solution works like a charm.

Eldar Khayrullin (eldar) wrote :

If you want set another functional key, do next, example:
$ gsettings get org.gnome.settings-daemon.plugins.media-keys previous
'XF86AudioPrev'
$ gsettings set org.gnome.settings-daemon.plugins.media-keys previous ''
$ gsettings set org.gnome.settings-daemon.plugins.media-keys volume-down XF86AudioPrev
After reboot you can volume down with media previous button.

P.S. you can set in GUI settings need short-key, then from gsettings add XF86 prefix .

HenryGR (henrygr) wrote :

My media Previous and Next keys stopped working, although they were assigned on System Settings >> ketboard >> shortcuts.
After resetting with GUI dconf-editor wirhout any success, I succied with the terminal commands:

~$ gsettings reset org.gnome.settings-daemon.plugins.media-keys next
~$ gsettings reset org.gnome.settings-daemon.plugins.media-keys previous

No sudo required.

zzarko (zzarko-gmail) wrote :

I can confirm this in latest 14.04.1 - changing media keys associations in keyboard shortcut settings puts incomplete strings in org.gnome.settings-daemon.plugins.media-keys.

Syr (syrmonsieur) wrote :

I also confirm this in version 14.04.1.
The editor assigns incorrect names for the media keys, missing the "XF86" prefix.

Teo (teo1978) wrote :

Is this the same as https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1248368 or not?

My volume keys were working until a few MINUTES AGO (last reboot).

This didn't fix them:
  gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-up
  gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-down

Any other workaround?

TomasHnyk (sup) wrote :

An workaround might be using xev (in terminal), pressing the button you want to use and noting its name,

KeyRelease event, serial 37, synthetic NO, window 0x6000001,
    root 0x9b, subw 0x0, time 37940588, (800,388), root:(859,440),
    state 0x10, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Its "XF86AudioRaiseVolume" in the output above. Then run dconf-editor and try to put this in appropriate place (they are described here http://askubuntu.com/questions/26056/where-are-gnome-keyboard-shortcuts-stored ).

Changed in unity-control-center (Ubuntu):
importance: Undecided → Medium
Iain Lane (laney) wrote :

I think the linked branch will fix this problem.

Changed in unity-control-center (Ubuntu):
assignee: nobody → Iain Lane (laney)
affects: unity-control-center (Ubuntu) → unity (Ubuntu)
Changed in unity (Ubuntu):
assignee: Iain Lane (laney) → nobody
assignee: nobody → Iain Lane (laney)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity - 7.3.1+14.10.20141015-0ubuntu1

---------------
unity (7.3.1+14.10.20141015-0ubuntu1) utopic; urgency=low

  [ Iain Lane ]
  * When grabbing keys, try prefixing "XF86" if the key isn't found.
    GNOME gives us unprefixed keys sometimes. (LP: #1302885)

  [ Brandon Schaefer ]
  * Remove bad tests that randomly fail

  [ handsome_feng<email address hidden> ]
  * added support for getting the distro name from /etc/os-release (LP:
    #1329584)

  [ Marco Trevisan (Treviño) ]
  * LockScreenController: wait the primary shield to get the grab before
    setting the session locked
  * GLibSignal: don't call callback function if the object_ value is not
    matching the CB (LP: #1366351)
 -- Ubuntu daily release <email address hidden> Wed, 15 Oct 2014 12:56:50 +0000

Changed in unity (Ubuntu):
status: Confirmed → Fix Released
Changed in unity:
assignee: nobody → Iain Lane (laney)
importance: Undecided → Medium
status: New → Fix Released
status: Fix Released → Fix Committed
milestone: none → 7.3.1
Dom (fianar2005-newsletter) wrote :

Tried dconf-editor GUI as Andriy Petruk (#8). Worked fine.
But still have the problem with:
BrightnessDown (fn-F5)
BrightnessUp (fn-F6)
Toggle screen on/off (fn-F7) works fine.
I couldn't find any about these keys in dconf-editor (like XF86BrightnessDn or whatever).
Is there a way to correctly configure the keys just as for the volume keys ?

Margarita Manterola (marga-9) wrote :

Can this be backported to Trusty as well, please?

Sure, we will work on getting this in a Trusty SRU.

sokolov (daniel-sokolov) wrote :

Marco Russo's solution from comment #9 did the trick on my 14.04 Gnome Classic system. Thank you!

defaria (andrew-defaria) wrote :

Is there something special you need to do after these "solutions". Because I did the gsettings thing to no avail. I tried the gnome3 thing and again, nothing changed. Do I need to logout and back in? Do I need to reboot?

A while ago something got flaky with X so I decided I should logout and back in. But I couldn't log back in so I had to reboot. When I finally got back in their were no sound icon, media keys didn't work. No notifications menu. Emerald wouldn't start, etc. etc. I finally got back up relatively normal but I can't get this media keys to work and I'm quite used to them. I'm afraid to even logout and back in let along reboot because who knows what kinda state I'm gonna come up in!

Coeur Noir (gerald-maruccia-e) wrote :

I just have had that bug, with volume up and down keys no longer working after changing some shortcuts through "system parameters → keyboard → shortcuts tab"

Solved by :

gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-down
gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-up

on Ubuntu 14.04

Hello Ivan, or anyone else affected,

Accepted unity into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/unity/7.2.4+14.04.20141217-0ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in unity (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed
Coeur Noir (gerald-maruccia-e) wrote :

After todays updates I've lost again the volume keys…

…but this time the sgettings commands had no effects to fix it.

Attached is screenshits of today's updates if any relevant ?

Coeur Noir (gerald-maruccia-e) wrote :

Sorry - lol - unintended typos ! please read :

gsettings instead of sgettings

and of course

screenshots instead of …

Amr Ibrahim (amribrahim1987) wrote :

Coeur, you have to update unity from trusty-proposed as instructed in comment #26 https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1302885/comments/26

Mathew Hodson (mathew-hodson) wrote :

The package in trusty-proposed doesn't solve the problem as described by Daniel Serpell in comment #4. After assigning the audio raise volume button as a shortcut in unity-control-center, the dconf key is set to 'AudioRaiseVolume' rather than 'XF86AudioRaiseVolume'.

$ apt list unity
Listing... Done
unity/trusty-proposed,now 7.2.4+14.04.20141217-0ubuntu1 amd64 [installed,automatic]
$ gsettings get org.gnome.settings-daemon.plugins.media-keys volume-up
'AudioRaiseVolume'
$ gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-up
$ gsettings get org.gnome.settings-daemon.plugins.media-keys volume-up
'XF86AudioRaiseVolume'

On Sun, Jan 18, 2015 at 06:45:25AM -0000, Mathew Hodson wrote:
> The package in trusty-proposed doesn't solve the problem as described by
> Daniel Serpell in comment #4. After assigning the audio raise volume
> button as a shortcut in unity-control-center, the dconf key is set to
> 'AudioRaiseVolume' rather than 'XF86AudioRaiseVolume'.

The fix is to make unity work when the key has this value.

So please check if the media key works and don't worry about the precise
value of the key.

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

quequotion (quequotion) wrote :

How does unity work around gnome-settings-daemon dropping support for media keys?

Does unity handle these keys itself now?

quequotion (quequotion) wrote :

or has that change not hit Ubuntu yet?

tags: added: verification-done
tags: removed: verification-needed
defaria (andrew-defaria) wrote :

None of this works for me! Been broken for a long time. Perhaps it's because I don't use Unity, and I use compiz and gnome classic. My

$ gsettings get org.gnome.settings-daemon.plugins.media-keys volume-up
'XF86AudioRaiseVolume'

but the volume up doesn't work. Nor volume down, pause, next, prev or play/pause. It's really annoying as those keys were handy.

Running xev and depressing volume up says the right thing "XF86AudioRaiseVolume" but it's as if the driver doesn't care that that key was pressed.

This keeps up I'll have to just go to some other distro.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity - 7.2.4+14.04.20141217-0ubuntu1

---------------
unity (7.2.4+14.04.20141217-0ubuntu1) trusty; urgency=medium

  [ Andrea Azzarone ]
  * Share lockscreen password between screens (lp: #1308540)
  * Allow a distinct pam config file for greeter and for lock-screen.
    (lp: #1305440)
  * Add an arrow activator in the lockscreen. (lp: #1332509)
  * Make sure GetScreenGeometry returns the correct value (lp: #1374785).
  * unmapped all windows prior to shutdown (lp: #1370017) (lp: #1375271)

  [ Brandon Schaefer ]
  * fix tooltip for the "Show Desktop / Restore Windows" icon in the Alt-Tab
    switcher (lp: #1237132)
  * Use CONFIG instead of CACHE to store the first_run.stamp (lp: #1328677)

  [ Eleni Maria Stea ]
  * LayoutSystem: make sure the exposed open windows are displayed in the
    preserved order (lp: #1349281).

  [ handsome_feng ]
  * added support for getting the distro name from /etc/os-release
    (lp: #1329584)

  [ Iain Lane ]
  * When grabbing keys, try prefixing "XF86" if the key isn't found. GNOME
    gives us unprefixed keys sometimes (lp: #1302885).

  [ Marco Trevisan (Treviño) ]
  * make the Launcher icon count badge width depend on the text value width
    and scaling (lp: #1353070) (lp: #1354498) (lp: #796527) (lp: #1066971)
    (lp: #1361713)
  * DecoratedWindow: make edges independent from borders and properly update
    them on actions change (lp: #1276177), (lp: #1299741), (lp: #1301776),
    (lp: #1324104), (lp: #1364225), (lp: #1373695)
  * Lockscreen: scale the UI elements based on current monitor scaling
    (lp: #1292218)
  * UnityScreen: when filtering out windows in spread, make sure we unscale
    them (lp: #1316265).
  * PanelMenuView: ensure that proper window tiles and buttons are shown at
    the right place (lp: #1384910) (lp: #1384958) (lp: #1385285)
  * SearchBar, ActionButtons, IconRenderer: include the font scaling when
    scaling textual items (lp: #1332947) (lp: #1361751) (lp: #1362162)
    (lp: #1362346).
  * ApplicationLauncherIcon: make sure we close the dash if DnD is accepted
    and the application window is about to be focused (lp: #1350331).
  * SwitcherView: set progress on icon render args (lp: #1361679).
  * LockScreenController: wait for the primary shield to get the grab
    before setting the session locked (lp: #1368427) (lp: #1371764).
  * added decorations to windows in non-focused workspaces (lp: #1383468)

  [ Stephen M. Webb ]
  * updated the unity(1) manpage to match the actual command (lp: #1059275)
  * bumped package version to match upstream

  [ Marco Trevisan (Treviño) ]
  * Preparing for unity 7.2.4
 -- Ubuntu daily release <email address hidden> Wed, 17 Dec 2014 20:52:10 +0000

Changed in unity (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for unity has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Stephen M. Webb (bregma) on 2015-02-11
Changed in unity:
status: Fix Committed → Fix Released
defaria (andrew-defaria) wrote :

I have Unity 7.2.4 and this doesn't fix anything for me. Keys still don't work.

quequotion (quequotion) wrote :

>>defaria

I think you may have encountered what I was getting at in #32

GNOME has tied hotkey support into gnome-shell, such that hotkeys no longer work without gnome-shell in any gnome-derivative desktops (like Unity).

The GNOME team has provided a utility to restore hotkey support without gnome-shell: gnome-fallback-media-keys-helper

At the moment, the only Ubuntu package available is in the Zorion OS PPA:
https://launchpad.net/~zorin-os/+archive/ubuntu/packages

Rather than add the whole PPA, it's probably a better idea to download the one package and install it with dpkg.

Updated from 14.04 to 14.10 today, and the keys on my wired mini-Apple keyboard stopped working. Non of the solutions in this thread work for me (and the PPA mentioned in #38 isn't available for 14.10).

11 unity 7.3.1+14.10.20141016-0ubuntu1

gsettings get org.gnome.settings-daemon.plugins.media-keys volume-up
'XF86AudioRaiseVolume'

gsettings get org.gnome.settings-daemon.plugins.media-keys volume-down
'XF86AudioLowerVolume'

gsettings get org.gnome.settings-daemon.plugins.media-keys volume-mute
'XF86AudioMute'

Grmbl.

Cs-gon (cs-gon) wrote :

The bug still exists for us in 14.04 with Unity 7.2.6. We have a lot of users (>10000) and this problem gets reported to us daily. I don't know a way to reproduce this, but sporadically media keys, Fn shortcuts (the systems are Lenovo T450s/T550 notebooks) and print screen stops working.

The keycodes in xev look right, and the users can still configure shortcuts, as in the corresponding GUI the shortcuts/meadia keys/etc. get recognized correctly, but still don't work afterwards.

quequotion (quequotion) wrote :

No one ever answered my question (#32):

How does unity work around gnome-settings-daemon dropping support for media keys?

There does appear to be code in unity-settings-daemon for this:
http://bazaar.launchpad.net/~unity-settings-daemon-team/unity-settings-daemon/trunk/files/head:/plugins/media-keys/

I cannot verify that code is functional as I am unwilling to install Unity.

>cs-gon
You can probably get away with installing the Saucy version of the package (download it from the lauchpad page, install with dpkg or gdebi); but I can't gurantee it will solve the problem permanently.

https://launchpad.net/~zorin-os/+archive/ubuntu/packages/+sourcepub/3778150/+listing-archive-extra

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers