Attention! This forum will be made read-only by Dec-20. Please migrate to https://forum.opencv.org. Most of existing active users should've received invitation by e-mail.
Ask Your Question
2

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

Comments

This might not be possible with opencv only on all platforms. Consider using another library (or win32/X11 API)

a739 gravatar imagea739 ( 2020-06-09 04:59:16 -0500 )edit

4 answers

Sort by ยป oldest newest most voted
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 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 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
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

1

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
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 3,580 times

Last updated: Feb 13 '13