Ask Your Question
0

is there a waitkey table?

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

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.

edit retag flag offensive close merge delete

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 ( 2016-08-22 02:57:59 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

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

Tetragramm gravatar image

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

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

Use the DEC column.

edit flag offensive delete link more

Comments

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

j0h gravatar imagej0h ( 2016-08-22 09:25:22 -0600 )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 -0600 )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 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 51,452 times

Last updated: Aug 21 '16