I am writing a program which tracks a laser light that is
shined onto a wall. The code is able to track the laser
fine, and I am able to recognize when the user "clicks" (by
turning the laser off and on real quick). However, I do not
know how to transmit this click information to the Operating
System.
What I am wondering is, is there a MATLAB function or some
other method I can use to generate a mouse click?
Subject: How to generate mouse clicks to the Operating System?
In article <fca6rr$mld$1@fred.mathworks.com>,
Shane Brennan <LoopUniverse+SPAM@gmail.com> wrote:
>I am writing a program which tracks a laser light that is
>shined onto a wall. The code is able to track the laser
>fine, and I am able to recognize when the user "clicks" (by
>turning the laser off and on real quick). However, I do not
>know how to transmit this click information to the Operating
>System.
>What I am wondering is, is there a MATLAB function or some
>other method I can use to generate a mouse click?
There is no Matlab function for it. There might be an
ActiveX control (maybe), or dll function you could use.
If you are using Windows, this page might be useful:
"Shane Brennan" <LoopUniverse+SPAM@gmail.com> wrote in
message <fca6rr$mld$1@fred.mathworks.com>...
> I am writing a program which tracks a laser light that is
> shined onto a wall. The code is able to track the laser
> fine, and I am able to recognize when the user "clicks" (by
> turning the laser off and on real quick). However, I do not
> know how to transmit this click information to the Operating
> System.
>
> What I am wondering is, is there a MATLAB function or some
> other method I can use to generate a mouse click?
% create a robot
import java.awt.*;
import java.awt.event.*;
rob=Robot;
rob.mousePress(InputEvent.BUTTON1_MASK)%change button here
%may want a pause here
rob.mouseRelease(InputEvent.BUTTON1_MASK)%change button here
% to see more robot options
methodsview(rob);
I learned how to do this when I wanted to write a matlab
program to draw lines in linerider.
I build a GUI and added a Listbox to it, now I have to
click the right mouse button to choose some of the listbox
items...My question: is it possible to do this right click
of the mouse by writing a M-Code in matlab...and thanks in
advance..
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.