Ask Your Question

Xazec's profile - activity

2017-04-10 06:50:32 -0600 received badge  Editor (source)
2017-04-10 04:03:54 -0600 asked a question Closing an image on left mouse click(OpenCV2 / Python 3.4)

Hey all,

The relevant part of my current code looks like this:

#a whole bunch of stuff that generates the image file
cv2.imshow(<image file>, img)
cv2.waitKey(0)
cv2.destroyAllWindows
#more stuff

Currently it closes, as expected, the image on a keypress.

What I'd like to do is, using a RPI + RPI touch screen, to close the image on a left mouse button press (any touch command to the screen in this case). Searching through the documentation I've been unable to find a way to do this, any pointers would be grealty appreciated.

edit: I know this is possible by just pressing the "x" in the top right, in real world use case this might prove to be difficult at times, hence I'd like to avoid it.