Navigation Menu

Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Consider adding global media key support in a WM-agnostic manner #188

Closed
GoogleCodeExporter opened this issue Apr 25, 2015 · 12 comments
Closed

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Run Cantata.
2. Focus on another window.
3. Press media keys.

What is the expected output? What do you see instead?
Expected: Media keys affect playback.
Actual: Nothing.

What version of the product are you using? On what operating system?
r2257 on Lubuntu 12.10 (Openbox WM)

Original issue reported on code.google.com by pr0ps...@gmail.com on 19 Mar 2013 at 11:19

@GoogleCodeExporter
Copy link
Author

In order for this to work, there would need to be some sort of daemon running 
to capture the keyboard events - hence this works in KDE, and GNOME/Unity as 
these have this daemon. I'm unsure of LXDE - as I've never used it.

Do any other Qt-based media player support media keys in Lubuntu?

Original comment by craig.p....@gmail.com on 20 Mar 2013 at 10:36

  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

I'm not sure about Qt-based media players, but Sonata (python-based, 
http://sonata.berlios.de/) has this functionality in LXDE (and other WMs I've 
tried it on).

Looking at the requirements, it seems to use dbus-python to grab media keys. I 
don't know if there's an equivalent for Qt.

Original comment by pr0ps...@gmail.com on 22 Mar 2013 at 4:37

@GoogleCodeExporter
Copy link
Author

But Sonata is using the GNOME MediaKeys daemon - which is what Cantata can be 
configured to use. Have you tried enabling Cantata's setting? Its in the 
Interface / External section.

I've just tried, and this works for me under Unity.

Original comment by craig.p....@gmail.com on 22 Mar 2013 at 9:20

@GoogleCodeExporter
Copy link
Author

I have that setting enabled (through multiple client and computer restarts).

I've also tried configuring the media keys as shortcuts in Settings -> 
Shortcuts. When the window is in focus they work, but they don't when the 
window is in the background.

If it matters, I've attached a log of running `xev | grep 
"KeyPress\|KeyRelease" -A 4` and pressing the media keys on my computer.

Original comment by pr0ps...@gmail.com on 22 Mar 2013 at 9:48

Attachments:

@GoogleCodeExporter
Copy link
Author

Do you have the GNOME media keys daemon running?

Configuring the short-cuts in Cantata's config dialog will only work for 
shortcuts when Cantata is active. Cantata only supports the KDE media keys, or 
the GNOME daemon.

You could always bind your keys to (e.g.):
    qdbus com.googlecode.cantata /org/mpris/MediaPlayer2 PlayPause

Original comment by craig.p....@gmail.com on 24 Mar 2013 at 3:58

@GoogleCodeExporter
Copy link
Author

I've added some code (in trunk) to attempt to start the gnome media keys daemon 
if Cantata is not being run under KDE. Perhaps this will solve the issue for 
you?

Can you please update to trunk, and try?

Original comment by craig.p....@gmail.com on 27 Mar 2013 at 10:04

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Updated to r2336, same behaviour.

Original comment by pr0ps...@gmail.com on 28 Mar 2013 at 6:29

@GoogleCodeExporter
Copy link
Author

Yeah, I noticed earlier. It starts the daemon, but looks like I also need to 
call the 'Start' method so that the media keys module is loaded.

Please update, and try again :-)

Original comment by craig.p....@gmail.com on 28 Mar 2013 at 7:18

@GoogleCodeExporter
Copy link
Author

I updated to r2352 and initially saw no change.

I added a few debug statements to verify the code was being executed. 
Basically, what I found was that when the program starts it tries to create the 
daemon (!daemon is true), and when flipping the setting on and off it doesn't 
create the daemon, but still tries to start it. This tells me the service isn't 
being started so I did a bit of digging with qdbusviewer.

You're going to hate me, but it seems that OpenBox doesn't support the 
"/org/gnome/SettingsDaemon/MediaKeys" bus by default. I used 
https://code.google.com/p/mediakeys-daemon/ to mimic the MediaKeys bus and the 
media keys started to work perfectly in Cantata (even in r2257).

Maybe you could put a note about this in the readme or something so it doesn't 
happen with other people?

Original comment by pr0ps...@gmail.com on 2 Apr 2013 at 9:28

@GoogleCodeExporter
Copy link
Author

So, do you not have /usr/lib/gnome-settings-daemon/gnome-settings-daemon 
installed on your system? When Cantata starts the dbus service, It is this app 
that should be executed.

Anyway, are you stating this should be marked as Fixed? Because I'm not sure 
what else Cantata can do.

Original comment by craig.p....@gmail.com on 3 Apr 2013 at 7:20

@GoogleCodeExporter
Copy link
Author

I don't have gnome-settings-daemon installed (which is why it wasn't working). 
I guess this is fixed since nothing was really broken in the first place...my 
bad.

Original comment by pr0ps...@gmail.com on 3 Apr 2013 at 10:50

@GoogleCodeExporter
Copy link
Author

No probs, at least we found the issue. Plus, Cantata will also now start the 
daemon if its not running - which might be useful for others who have it 
installed, but run (e.g.) IceWM...

Original comment by craig.p....@gmail.com on 4 Apr 2013 at 8:22

  • Changed state: Invalid

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant