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/loop.py

29 lines
596 B
Python
Raw Permalink Normal View History

2022-07-11 21:40:24 +00:00
#!/usr/bin/python3
2023-02-25 18:59:41 +01:00
import os
2023-03-05 13:12:19 +01:00
import sys
2023-02-25 18:59:41 +01:00
2022-07-11 21:40:24 +00:00
def waitMouseClick():
2023-02-25 18:59:41 +01:00
mouse = open("/dev/input/mice", "rb")
down = False
2022-07-11 21:40:24 +00:00
while True:
buf = mouse.read(3)
2023-02-25 18:59:41 +01:00
if ((buf[0] & 0x1) == 1):
2022-07-25 01:00:07 +02:00
down = True
2023-02-25 18:59:41 +01:00
if (((buf[0] & 0x1) == 0) and down):
break
2022-07-11 21:40:24 +00:00
mouse.close()
2023-02-25 18:59:41 +01:00
2023-03-05 13:12:19 +01:00
# Hide blinking cursor
sys.stdout.write("\033[?1;0;0c")
sys.stdout.flush()
2022-07-11 21:40:24 +00:00
while True:
os.system("killall fim")
2022-07-12 16:16:14 +00:00
os.system("fim -qa image1.png 2>/dev/null &")
2022-07-11 21:40:24 +00:00
waitMouseClick()
os.system("killall fim")
2022-07-12 16:16:14 +00:00
os.system("fim -qa image2.png 2>/dev/null &")
2022-07-11 21:40:24 +00:00
waitMouseClick()