How do I get headset button events without .btscorc?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.
I figured this one out all  on my own!  Here is a script in python that
uses dbus to get the bluetooth headset button press.  I think it might be
helpful to add this to the wiki.

<pre>

def handler(sender=None):
	os.system ('/usr/bin/twinkle --cmd answerbye') # <- that's the part
specific to twinkle
import dbus, os,  gobject
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
bus.add_signal_receiver(handler, signal_name="AnswerRequested")
loop = gobject.MainLoop()
loop.run()

</pre>

Dave


--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux