def mouse_event(event, x, y, flags, param): global should_exit if event == cv2.EVENT_LBUTTONUP: print("mouse_event:L-click") should_exit = True