title: openCV waitKey() can't get proper keyboard input
body: <p>I followed a tutorial, and tried to make the program quit when I press <code>q</code>, but that doesn't work, it quits no matter which key I press, that's the code:</p>
  
  <pre><code>twi = cv2.imread('large.png')
  cv2.namedWindow('image', cv2.WINDOW_NORMAL)
  cv2.imshow('image', twi)
  key = cv2.waitKey(0)
  if key == ord('q'):
      cv2.destroyAllWindows()
  </code></pre>
  
  <p>And I've tried to add <code>&amp;0xFF</code>:</p>
  
  <pre><code>key = cv2.waitKey(0)&amp;0xFF
  </code></pre>
  
  <p>Still not working, what is wrong with it? Can I fix it?</p>
  
  <p>=============Update============</p>
  
  <p>I added <code>print(key)</code> to that, when pressing <code>q</code>, variable <code>key</code> is <code>113</code>, and <code>ord('q')</code> is <code>113</code> either, can't understand why it doesn't work...</p>
  
  <p>=============Solved=============</p>
  
  <p>(Seems that I forget how <code>if</code> works...)</p>