0

I am on OSX. I am importing opencv-python, so it might help; however, I am not showing anything, it's all command line off-screen processing.

While True:
   do work .... 
   key = cv2.waitKey(1)
   print key

The call to cv2.waitKey(1) consistently returns -1. If I call cv2.imshow(..) before it, then it behaves correctly.

However, I have nothing to show, any chance I can still detect a keypress?

I need a keypress which isn't ctrl+c

sramij
  • 4,775
  • 5
  • 33
  • 55
  • 1
    Can you use the `ncurses` or `keyboard` Python modules? https://stackoverflow.com/questions/24072790/detect-key-press-in-python – snibbets Jan 22 '19 at 04:42
  • @snibbets I couldn't get any of keyboard, ncurses to work on OSX. 'keyboard' just kept crashing. – sramij Jan 22 '19 at 14:59

0 Answers0