im wanting to create a python script that runs in the background of lxde to monitor the left hand mouse click. if the mouse is clicked it turns on gpio pin 4. if after 30 seconds of non clicking it turns off gpio pin 4.
i think i need to use the "time" import and some sort of loop listening for the mouse click.
something like :-
if mouse click then goto "on"
when time equals 30 gpio 4 off
gpio 4 on
however i lack the knowledge to put this together in python. any guide would be usefull