Hold Shift key down and Mouse Click event

I would like to respond when user hold the shift key down and mouse click.
How can I catch these two events occuring at the same time?
qkrwngmlAsked:
Who is Participating?
 
mahesh1402Connect With a Mentor Commented:
Check on out OnLButtonDown( UINT nFlags, CPoint point );
If the MK_SHIFT bit is set in the nFlags parameter, the shift key is down.

void CMyView::OnLButtonDown(UINT nFlags, CPoint point)
  {
    if (nFlags & MK_SHIFT) {
      //shift key is pressed ..DO Processing
    }
    CView::OnLButtonDown(nFlags, point);
  }

-MAHESH
0
 
Mark_FreeSoftwareCommented:

to do that global, use a key/mouse hook

set a flag when shift is pressed, unset it when shift is released

now in the mouse hook, check if the good button is pressed, and check for the shift flag
0
 
qkrwngmlAuthor Commented:
Great mahesh1402!
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.