I found a solution without keyboard module, but answers to previous questions are still appreciated.
Withthis is basic "keyboard event loop":
With
Code:
from sys import stdinfrom tty import setrawimport termios
Code:
pi@raspberrypi5:~/picamera2/examples $ tail zoom.pycam(1)# because Python version <3.12tty_attrs = termios.tcgetattr(stdin.fileno())setraw(stdin.fileno())c = stdin.read(1)while c!='q' and ord(c)!=3: c = stdin.read(1)termios.tcsetattr(stdin.fileno(), termios.TCSAFLUSH, tty_attrs)pi@raspberrypi5:~/picamera2/examples $
Statistics: Posted by HermannSW — Wed Jun 26, 2024 2:21 pm