Ask Your Question

is there a waitkey table?

asked 2016-08-21 12:24:24 -0500

j0h gravatar image

I'd like to give waitkey commands for any given letter. Imagined there would be a table with (letter == N ) on the waitkey API, but I did not see it. what are the numbers for a,s,d,w respectively? Or is there something that says what each key is someplace?

not sure what I mean? Heres the keypress codes for SDL. Im looking for something like that, buy for the OpenCV waitkey codes

Im looking for C++, but python would be good too, if they are not the same.

edit retag flag offensive close merge delete


I'm not sure to understand.

char c;
if (c='N')

It's only ASCII code. For key function I think value return is always 0 if use char type with int you have a key code may be platform sensitive.. F1 7340032 for windows10 left arrow 2424832

LBerger gravatar imageLBerger ( 2016-08-22 02:57:59 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2016-08-21 18:54:05 -0500

Tetragramm gravatar image

updated 2016-08-21 18:54:33 -0500

There is.

Use the DEC column.

edit flag offensive delete link more


Nice, I was off by 32, but i got it now.

j0h gravatar imagej0h ( 2016-08-22 09:25:22 -0500 )edit

If it is off by 32 than that means you did not do waitKey() & 0xFF which is mandatory to get the correct output on every system ;) luckely there is a PR awaiting merging trying to solve this issue through a waitChar() function!

StevenPuttemans gravatar imageStevenPuttemans ( 2016-08-23 04:59:32 -0500 )edit

This list is very useful. I want to detect backspace so I just check whether key == 8

off99555 gravatar imageoff99555 ( 2020-10-17 03:04:40 -0500 )edit

Question Tools

1 follower


Asked: 2016-08-21 12:24:24 -0500

Seen: 31,468 times

Last updated: Aug 21 '16