title: cvWaitkey for for increasing values
body: <p>I have a program written in c++ with opencv which should calculate a disparity map. Now I want to play around with the values wihin a while loop looking like this:</p>
  
  <pre><code>while(true) {
  
    cv::StereoSGBM disparity(minDISP,numDISP,SADWindowSize, disparitySmoothness1, disparitySmoothness2);
    cv::Mat disparityMap, disparityNorm;
  
    disparity(undistortedLeft[1], undistortedRight[1], disparityMap);
    disparityMap*=(1/16.0);
    cv::normalize(disparityMap, disparityNorm, 0,255, cv::NORM_MINMAX, CV_8U);
    cv::imshow("disparityMap", disparityNorm);
    key = cv::waitKey(0);
  
    switch(char(key)) {
      case 'n': numDISP+=16;
      case 'm': minDISP+=1;
      case 's': SADWindowSize+=2;
      case 'q': break;
    }
  }
  </code></pre>
  
  <p>key is declared as <code>char key;</code></p>
  
  <p>the problem I have now is the following.
  If I press <code>n</code> everything is working well, if I press <code>m</code> the program increases <code>n</code> and <code>s</code> as well. The same if I press <code>s</code>. If I press <code>q</code> nothing is happening.</p>
  
  <p>I also tried it using if else statements and it was the same result.
  Is this because of <code>key</code> saves the buttons pressed before in any way?</p>
  
  <p>Maybe someone of you can help me with this.</p>