mirror of
https://github.com/dbarzin/pandora-box.git
synced 2025-07-24 07:49:42 +02:00
work on mouse click
This commit is contained in:
parent
d9cc0b1ef2
commit
7d52bcdfd6
2 changed files with 4 additions and 1 deletions
|
@ -2,9 +2,12 @@
|
||||||
|
|
||||||
def waitMouseClick():
|
def waitMouseClick():
|
||||||
mouse = open( "/dev/input/mice", "rb" )
|
mouse = open( "/dev/input/mice", "rb" )
|
||||||
|
down = False;
|
||||||
while True:
|
while True:
|
||||||
buf = mouse.read(3)
|
buf = mouse.read(3)
|
||||||
if ((buf[0] & 0x1)==1):
|
if ((buf[0] & 0x1)==1):
|
||||||
|
down = True
|
||||||
|
if (((buf[0] & 0x1)==0) and down):
|
||||||
break;
|
break;
|
||||||
mouse.close()
|
mouse.close()
|
||||||
|
|
||||||
|
|
|
@ -11,4 +11,4 @@ def waitMouseClick():
|
||||||
|
|
||||||
os.system("fim *.png -qa -c 'while(1){display;sleep 1;next;}' </dev/null 2>/dev/null &")
|
os.system("fim *.png -qa -c 'while(1){display;sleep 1;next;}' </dev/null 2>/dev/null &")
|
||||||
waitMouseClick()
|
waitMouseClick()
|
||||||
os.system("killall fim")
|
os.system("killall -s 9 fim")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue