I\'m working on a program (python ,opencv) in which I use the spacebar to go to the next frame, and Esc to exit the program. These are the only two
spacebar
Esc
For C++:
In case of using keyboard characters/numbers, an easier solution would be:
int key = cvWaitKey(); switch(key) { case ((int)('a')): // do something if button 'a' is pressed break; case ((int)('h')): // do something if button 'h' is pressed break; }