1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-20 13:59:40 +02:00
pandora-box/tests/mouse-click.py

16 lines
311 B
Python
Raw Normal View History

2022-06-11 16:26:40 +02:00
#!/usr/bin/python3
2022-06-30 08:30:43 +00:00
def waitMouseClick():
2022-06-30 10:32:30 +02:00
mouse = open( "/dev/input/mice", "rb" )
2022-07-14 14:00:37 +02:00
down = False;
2022-06-30 08:30:43 +00:00
while True:
buf = mouse.read(3)
if ((buf[0] & 0x1)==1):
2022-07-14 14:00:37 +02:00
down = True
if (((buf[0] & 0x1)==0) and down):
2022-06-30 08:30:43 +00:00
break;
2022-06-30 10:33:27 +02:00
mouse.close()
2022-06-11 16:26:40 +02:00
2022-06-30 08:30:43 +00:00
waitMouseClick()
2022-06-11 16:26:40 +02:00