From: yasiru on
I need to develop a project in which i need to control movement of the mouse pointer on my screen by moving my hand in front of a web camera.i can track hand and can plot graph from it .this is the video from it .

http://www.youtube.com/watch?v=hYrzaHmZZjc

now i want to control the mouse .but i dont know mouse pointer function in matlab to handle mouse.
plz help me
From: Jan Simon on
Dear yasiru,

> I need to develop a project in which i need to control movement of the mouse pointer on my screen by moving my hand in front of a web camera.i can track hand and can plot graph from it .this is the video from it .
>
> now i want to control the mouse .but i dont know mouse pointer function in matlab to handle mouse.

On Windows you can set the position of the Mouse cursor with:
set(0, 'PointerLocation', [X, Y]);
More flexible and most likely working on Linux and MacOS also:
robot = java.awt.Robot;
robot.mouseMove(X, Y)
robot.mousePress(java.awt.event.InputEvent.BUTTON1_MASK);
robot.mouseRelease(java.awt.event.InputEvent.BUTTON1_MASK);

Good luck, Jan
From: Jan Simon on
Dear Yasiru,

> now i want to control the mouse .but i dont know mouse pointer function in matlab to handle mouse.

BTW.: See also this thread from today:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/285933
Sometimes reading other posts can be helpful.

Kind regards, Jan
From: yasiru on
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <i0k3mc$7h2$1(a)fred.mathworks.com>...
> Dear yasiru,
>
> > I need to develop a project in which i need to control movement of the mouse pointer on my screen by moving my hand in front of a web camera.i can track hand and can plot graph from it .this is the video from it .
> >
> > now i want to control the mouse .but i dont know mouse pointer function in matlab to handle mouse.
>
> On Windows you can set the position of the Mouse cursor with:
> set(0, 'PointerLocation', [X, Y]);
> More flexible and most likely working on Linux and MacOS also:
> robot = java.awt.Robot;
> robot.mouseMove(X, Y)
> robot.mousePress(java.awt.event.InputEvent.BUTTON1_MASK);
> robot.mouseRelease(java.awt.event.InputEvent.BUTTON1_MASK);
>
> Good luck, Jan

thanks i did it.

http://www.youtube.com/watch?v=CURiHWRo7CI
From: yasiru on
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <i0k45a$72a$1(a)fred.mathworks.com>...
> Dear Yasiru,
>
> > now i want to control the mouse .but i dont know mouse pointer function in matlab to handle mouse.
>
> BTW.: See also this thread from today:
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/285933
> Sometimes reading other posts can be helpful.
>
> Kind regards, Jan


thank jan