[tuxdroid-svn] r326 - api/python/trunk
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2007-05-29 14:55:28
|
Author: jaguarondi Date: 2007-05-29 16:54:54 +0200 (Tue, 29 May 2007) New Revision: 326 Modified: api/python/trunk/tuxapi_class.py Log: - UPD: issue #30 - patch from Vincent Fretin to fix documentation. Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2007-05-26 13:59:44 UTC (rev 325) +++ api/python/trunk/tuxapi_class.py 2007-05-29 14:54:54 UTC (rev 326) @@ -592,10 +592,10 @@ "on_head_bt_released" as pof : On tux head button released "on_lwing_bt_released" as pof : On tux left wing button released "on_rwing_bt_released" as pof : On tux right wing button released - "on_remote_bt" as tuple of pof : On remote controller button pressed - param 1 : Key as integer + "on_remote_bt" as list of pof : On remote controller button pressed "on_status" as pof : On status arrival "on_remote" as pof : On remote controller event + param 1 : Key as integer "on_light_level" as pof : On light level event param 1 : light value as integer "on_connected" as pof : On api connected to tuxdaemon @@ -627,8 +627,13 @@ Example of associating a function to a remote event: >>> def my_function(key): >>> print "Button %s is pressed"%remote_bt_name[key] - >>> tux.event.on_remote_bt=my_function + >>> tux.event.on_remote=my_function + Example of associating a function to a specific remote event: + >>> def play_pause(): + >>> tux.sys.shell("audacious --play-pause") + >>> tux.event.on_remote_bt[K_PLAYPAUSE]=play_pause + Key constants of the remote controller: (K_0,K_1,K_2,K_3,K_4,K_5,K_6,K_7,K_8,K_9,K_STANDBY, K_MUTE,K_VOLUMEPLUS,K_VOLUMEMINUS,K_ESCAPE,K_YES, @@ -2039,7 +2044,7 @@ """ while self.parent.daemon.connected: if self.parent.event.on_light_level!=None: - self.parent.event.on_light_level(self.get_light_level()) + self.parent.event.on_light_level(self.light_level()) self.parent.sys.wait(1) #-------------------------------------------------------------------------- |