Ticket #606 (closed bug: fixed)

Opened 21 months ago

Last modified 9 months ago

Support media player keyboard-shortcuts (like found on many laptops)

Reported by: zdogde Owned by: theli
Priority: major Milestone: 0.6
Component: Core Version: trunk
Keywords: key, shortcut, media, laptop, buttons Cc: pochu@…

Description

Many keyboards and laptops have additional buttons to control a media player application. In Gnome under System->Administration->Key Bindings (or similar) you can customize the Key Bindings for "Play/Pause", "Stop", "Next", "Previous" etc.

Rythmbox supports those buttons and I noticed that Listen doesn't. This means that if I bind a key to "Stop" it works in Rythmplayer, but Listen does not stop playback if I press the key. (Perhabs a global key hook is required?... I don't know)

Attachments

mmkeys.patch (2.5 kB) - added by vector_prime 19 months ago.
Fixes multimedia keys on Gnome 2.18

Change History

Changed 21 months ago by pochu

  • cc pochu@… added

Yes, this would be really appreciated!

Also, I think this is a regression from 0.5-beta. I think it worked with it, but now it doesn't work (maybe the changes in dbus?)

Best regards Emilio

Changed 21 months ago by pochu

Confirmed. Works fine with 0.5-beta.

Changed 20 months ago by pochu

  • priority changed from minor to major
  • version changed from 0.5 to trunk

I think the problem is the listen launcher (listen.py in listen 0.5 and before, listen in the trunk) doesn't have the multimedia keys configuration (it has been removed when updating it).

It should have something similar to this (from 0.5-beta1):

from helper import helper

if message=="current-song":

song = self.listen_instance.player_ui.player.song if not self.listen_instance.player_ui.player.paused:

return song.sprint("title")+ " - ("+song.get_str("album")+" - "+song.get_str("artist")+")"

else:

return _("No playing song")

elif message=="next":

helper.control("next") return "Command successful"

elif message=="previous":

helper.control("previous") return "Command successful"

elif message=="play-pause":

helper.control("play") return "Command successful"

elif message=="play-device":

helper.play_device(arg) return "Command successful"

elif message=="volume":

try: value = float(arg) except:

return _("Fail to set volume")

helper.volume(value) return "Command success"

else:

return "oups"

But instead of "from helper import helper" it should be "from helper import Dispatcher", and it should probably be updated, to support the new Stop function in Listen.

Changed 19 months ago by vector_prime

Fixes multimedia keys on Gnome 2.18

Changed 19 months ago by vector_prime

  • status changed from new to closed
  • resolution set to fixed

I've attached a patch that should fix the multimedia keys on Gnome. Most of the code's stolen from the folks at Exaile, so credit where credit's due.

Changed 19 months ago by theli

thanks a lot

Changed 9 months ago by Forlong

This still doesn't work for me in the latest trunk version.

The version in Ubuntu works fine but it's only 0.5 and therefore lacks the stop-function I'd like to have here.

Note: See TracTickets for help on using tickets.