开发者

right click event in opencv

开发者 https://www.devze.com 2023-01-01 17:56 出处:网络
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

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开发者_如何学C .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 .??


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消