2

I am doing a project to control mouse events by hand gestures using opencv in linux. I am able to control the mouse pointer with my hand movements.

I have achieved counting the number of fingers in the hands. I want to trigger mouse events depending upon the number of fingers shown. In windows there is a function mouse_event. But i am working in linux.

If there is any function for click events in opencv(linux) please let me know. Also help me with the header files to be included for those functions.

Thanks in advance!!

meesun
  • 57
  • 6
  • possible duplicate of [How to control mouse movement in linux?](http://stackoverflow.com/questions/7675379/how-to-control-mouse-movement-in-linux) – karlphillip Aug 03 '13 at 11:44

1 Answers1

0

You can use Xlib library for handling mouse events in Linux environment. Xlib is an XWindow System protocol library. It contains functions for interacting with an X server. Main advantage of using Xlib in you project is that, you can handle mouse events globally( throughout the desktop, or in other window, not locally in your application window ).

Check out Xlib-MouseClick.

Just call the function mouseClick() in your program with argument -

0 - for left click,

1 - for middle click, and

2 - for right click, at current position of mouse pointer.

Saikat
  • 1,209
  • 3
  • 16
  • 30