Ask Your Question
1

cv::waitKey() upper-/lowercase difference

asked 2012-11-17 06:13:08 -0500

Storm gravatar image

updated 2012-11-18 04:37:35 -0500

Hi! Is there a simple method to determine whether the Shift key was pressed together with another one? For example, I want to do different actions on 'u' and 'U'.

UPD: cv::getBuildInformation() output

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
2

answered 2012-11-17 07:35:58 -0500

sammy gravatar image

waitKey returns the ASCII code for the letter. It is different for uppercase and lowercase letters.

char c = cv::waitKey();
if(c == 'u') {}
if(c == 'U') {}
edit flag offensive delete link more

Comments

It was first, what I've tried, but I am getting 'u' (117) in both cases. I've added OpenCV build info in my question.

Storm gravatar imageStorm ( 2012-11-18 04:41:28 -0500 )edit
0

answered 2013-02-13 05:27:58 -0500

big_mu5 gravatar image

updated 2013-02-13 05:28:19 -0500

I have similar problem, in my case, cvWaitKey does not really capture the difference between lower and upper case letters. A colleague told me that he solved this problem by compiling openCV from sources. I guess it might have smth to do with 64bit

edit flag offensive delete link more
0

answered 2013-02-13 09:08:06 -0500

unxnut gravatar image

I just tried it using build 2.4.3 and I received uppercase and lowercase letters as typed.

edit flag offensive delete link more
0

answered 2012-11-18 08:39:45 -0500

Victor1234 gravatar image

As i know key code return qt, not OpenCV, try to set it up, i have some strange result too at once.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2012-11-17 06:13:08 -0500

Seen: 3,291 times

Last updated: Feb 13 '13