First time here? Check out the FAQ!

Ask Your Question
0

is there a waitkey table?

asked Aug 21 '16

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. https://wiki.libsdl.org/SDL_Keycode 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.

Preview: (hide)

Comments

I'm not sure to understand.

char c;
c=waitKey();
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 (Aug 22 '16)edit

1 answer

Sort by » oldest newest most voted
2

answered Aug 22 '16

Tetragramm gravatar image

updated Aug 22 '16

There is. http://www.asciitable.com/

Use the DEC column.

Preview: (hide)

Comments

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

j0h gravatar imagej0h (Aug 22 '16)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 (Aug 23 '16)edit

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

off99555 gravatar imageoff99555 (Oct 17 '0)edit

Question Tools

1 follower

Stats

Asked: Aug 21 '16

Seen: 52,407 times

Last updated: Aug 21 '16