Grabbing multimedia keys

Ankur Sinha <[email protected]>
Newsgroups gmane.comp.gnome.love
Message-ID <[email protected]>
hello,

I've recently started using indimpc[1]. It's just a tiny program that
grabs your multimedia keys and lets you use them to control mpd. There's
a glitch here, which I'd like some help on:

If indimpc is running, and I run totem, the multimedia keys start to
affect them both. So, if I want to pause totem, the pause multimedia key
will have two results:
- pause totem
- play mpd

This is the code snippet from indimpc:


> 	def grab_mmkeys(self):
> 		try:
> 			keysbus = self.bus.get_object("org.gnome.SettingsDaemon", "/org/gnome/SettingsDaemon/MediaKeys")
> 			keysbus.GrabMediaPlayerKeys("indimpc", 0, dbus_interface="org.gnome.SettingsDaemon.MediaKeys")
> 			keysbus.connect_to_signal("MediaPlayerKeyPressed", self.delegate_mediakeys)
> 		except:
> 			sys.stderr.write("[WARNING] indimpc: can't grab multimedia keys using gnome-settings-daemon.\n")
> 			try:
> 				import keybinder
> 				keybinder.bind("XF86AudioPlay", self.toggle_playback)
> 				keybinder.bind("XF86AudioStop", self.stop)
> 				keybinder.bind("XF86AudioPrev", self.play_previous)
> 				keybinder.bind("Xf86AudioNext", self.play_next)
> 			except:
> 				sys.stderr.write("[WARNING] indimpc: can't grab multimedia keys using keybinder either.")
> 

I was wondering if there's a way to ensure that indimpc only has the
multimedia key when no other program is holding them. Is there a way to
do this? Maybe give it least priority?

Any suggestions would be appreciated :)

[1] https://github.com/fmoralesc/indimpc
-- 
Thanks, 
Regards,
Ankur: "FranciscoD"

http://fedoraproject.org/wiki/User:Ankursinha
http://dodoincfedora.wordpress.com/

_______________________________________________
gnome-love mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-love
signature.asc (application/pgp-signature, 490 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQEcBAABAgAGBQJPioDtAAoJEKgwcD8HZ+sIGJ4H/2ETvd2dFmqedfWk6IMlTsGx
gwIAKB1lcvjELGBJIqjeKk1993wVHtSNFl5jw2DUwQ0tbrLg4NHD+l03RQfPotBr
yVgTPRy2BCTL6Lu/7HzJSUtd2NW1R08SxSX5WAELX1uFNG5AffP7eiyJXPjRhte7
7Refxny2aMS7+yK5qEZP5aohxqvqglQkaxXXeiLmBxZV3IUlb9BKrwHc/3+E4qPP
mJWCiGCqv7fxy6QFnJaokoNAPiKDlveabkD/4xI/OLw2XnceBGxqVcxZ4kYIWtwu
z2FY7J9Ox9hCzdvbmkKeuYcOxGotad51bh2c8piZE+afWu2v0GnlkpOGniVPyfk=
=8ArD
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.