I have a simple Python script to take photos using laptop camera based on this post.
In particular, the user can exit the program by pressing ESC. Below is part of the script
# cv2 is OpenCV module
key = cv2.waitKey(1)
# ESC is pressed
if k % 256 == 27:
print("ESC is pressed, exit ...")
break
While everything works fine. But when the keyboard is changed to other input (e.g. Russian, Chinese), pressing any keys (Here, any means A,B,C,...,Z key) while the video is streaming terminates the program with the following error prints out.
ASSERT: "false" in file qasciikey.cpp, line 501
Abort trap: 6
This error is not found when using English / French / German keyboard.
How can I handle this problem properly in my Python script? Thanks