tags:

views:

94

answers:

1

Hello all,

I am developing a computer vision program using OpenCV (IDE = devcpp). I am able to get the hand contour , move cursor position according to our our hand. i want to implement right click functionality .Please help me with it .

i am using event SetCursorPos(x,y) to set the cursor position on the screen. is there any simple function to implement rightclick the same way .??

+1  A: 

Maybe this will help: http://www.codeguru.com/forum/showthread.php?t=377394

void RightClick ( )
{  
  INPUT    Input={0};
  // right down 
  Input.type      = INPUT_MOUSE;
  Input.mi.dwFlags  = MOUSEEVENTF_RIGHTDOWN;
  ::SendInput(1,&Input,sizeof(INPUT));

  // right up
  ::ZeroMemory(&Input,sizeof(INPUT));
  Input.type      = INPUT_MOUSE;
  Input.mi.dwFlags  = MOUSEEVENTF_RIGHTUP;
  ::SendInput(1,&Input,sizeof(INPUT));
}

And to use:

RightClick();

The link shows examples for left clicking, mouse move, etc. too.

jhaip
Thanx for reply .This is the solution i used to get my work done .
Himz