title: cv2.waitKey returns 255 for all keys
body: <p>I am trying to read the key value using cv2.waitKey(0) but it doesn't work. It waits forever. I used cv2.waitKey(1) to check what it returns and it was always 255 no matter which key I pressed.</p>
  
  <pre><code>while True:
        key = cv2.waitKey(0)
        print(key)
  </code></pre>
  
  <p>The above code does nothing, no matter whichever key I press.</p>
  
  <pre><code>while True:
       key = cv2.waitKey(1) &amp; 0xFF
       print(key)
       if key == ord('q'):
          break
  </code></pre>
  
  <p>keeps printing 255 and doesn't break if I press 'q'. </p>