def on_mediakey(comes_from, what):
    """ gets called when multimedia keys are pressed down.
    """
print('comes from:%s  what:%s' % (comes_from, what))
if what in ['Stop', 'Play', 'Next', 'Previous']:
    print('Got a multimedia key!')
else:
    print('Got a multimedia key...')
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.Bus(dbus.Bus.TYPE_SESSION)
bus_object = bus.get_object('org.gnome.SettingsDaemon',
    '/org/gnome/SettingsDaemon/MediaKeys')
dbus_interface = 'org.gnome.SettingsDaemon.MediaKeys'
bus_object.GrabMediaPlayerKeys('MyMultimediaThingy', 0, dbus_interface=
    dbus_interface)
bus_object.connect_to_signal('MediaPlayerKeyPressed', on_mediakey)
mainloop = gobject.MainLoop()
mainloop.run()
Как вы прослушиваете события Mediakey в gnome 3 с помощью python?