1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-18 21:09:41 +02:00
pandora-box/tests/mouse-click.py

16 lines
303 B
Python
Raw Permalink Normal View History

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