<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156064</link>
    <title>MATLAB Central Newsreader - How to generate mouse clicks to the Operating System?</title>
    <description>Feed for thread: How to generate mouse clicks to the Operating System?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 13 Sep 2007 02:21:47 -0400</pubDate>
      <title>How to generate mouse clicks to the Operating System?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156064#392027</link>
      <author>Shane Brennan</author>
      <description>I am writing a program which tracks a laser light that is&lt;br&gt;
shined onto a wall. The code is able to track the laser&lt;br&gt;
fine, and I am able to recognize when the user &quot;clicks&quot; (by&lt;br&gt;
turning the laser off and on real quick). However, I do not&lt;br&gt;
know how to transmit this click information to the Operating&lt;br&gt;
System.&lt;br&gt;
&lt;br&gt;
What I am wondering is, is there a MATLAB function or some&lt;br&gt;
other method I can use to generate a mouse click?</description>
    </item>
    <item>
      <pubDate>Thu, 13 Sep 2007 02:39:04 -0400</pubDate>
      <title>Re: How to generate mouse clicks to the Operating System?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156064#392030</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fca6rr$mld$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
Shane Brennan &amp;lt;LoopUniverse+SPAM@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;I am writing a program which tracks a laser light that is&lt;br&gt;
&amp;gt;shined onto a wall. The code is able to track the laser&lt;br&gt;
&amp;gt;fine, and I am able to recognize when the user &quot;clicks&quot; (by&lt;br&gt;
&amp;gt;turning the laser off and on real quick). However, I do not&lt;br&gt;
&amp;gt;know how to transmit this click information to the Operating&lt;br&gt;
&amp;gt;System.&lt;br&gt;
&lt;br&gt;
&amp;gt;What I am wondering is, is there a MATLAB function or some&lt;br&gt;
&amp;gt;other method I can use to generate a mouse click?&lt;br&gt;
&lt;br&gt;
There is no Matlab function for it. There might be an&lt;br&gt;
ActiveX control (maybe), or dll function you could use.&lt;br&gt;
If you are using Windows, this page might be useful:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/ms171548.aspx&quot;&gt;http://msdn2.microsoft.com/en-us/library/ms171548.aspx&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
I found a different page that indicated that simulating a&lt;br&gt;
right click might be relatively difficult:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.daniweb.com/forums/thread10948.html&quot;&gt;http://www.daniweb.com/forums/thread10948.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Okay, buzzwords only. Two syllables, tops.  -- Laurie Anderson</description>
    </item>
    <item>
      <pubDate>Thu, 13 Sep 2007 05:10:33 -0400</pubDate>
      <title>Re: How to generate mouse clicks to the Operating System?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156064#392040</link>
      <author>Dan Haeg</author>
      <description>&quot;Shane Brennan&quot; &amp;lt;LoopUniverse+SPAM@gmail.com&amp;gt; wrote in&lt;br&gt;
message &amp;lt;fca6rr$mld$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I am writing a program which tracks a laser light that is&lt;br&gt;
&amp;gt; shined onto a wall. The code is able to track the laser&lt;br&gt;
&amp;gt; fine, and I am able to recognize when the user &quot;clicks&quot; (by&lt;br&gt;
&amp;gt; turning the laser off and on real quick). However, I do not&lt;br&gt;
&amp;gt; know how to transmit this click information to the Operating&lt;br&gt;
&amp;gt; System.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; What I am wondering is, is there a MATLAB function or some&lt;br&gt;
&amp;gt; other method I can use to generate a mouse click?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
% create a robot&lt;br&gt;
import java.awt.*;&lt;br&gt;
import java.awt.event.*;&lt;br&gt;
rob=Robot;&lt;br&gt;
rob.mousePress(InputEvent.BUTTON1_MASK)%change button here&lt;br&gt;
%may want a pause here&lt;br&gt;
rob.mouseRelease(InputEvent.BUTTON1_MASK)%change button here&lt;br&gt;
&lt;br&gt;
% to see more robot options&lt;br&gt;
methodsview(rob);&lt;br&gt;
&lt;br&gt;
I learned how to do this when I wanted to write a matlab&lt;br&gt;
program to draw lines in linerider.&lt;br&gt;
&lt;br&gt;
this site has more information about the robot&lt;br&gt;
&lt;a href=&quot;http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Robot.html#mousePress(int)&quot;&gt;http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Robot.html#mousePress(int)&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Thu, 13 Sep 2007 07:01:54 -0400</pubDate>
      <title>Re: How to generate mouse clicks to the Operating System?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156064#392047</link>
      <author>us</author>
      <description>Shane Brennan:&lt;br&gt;
&amp;lt;SNIP to weak to press a button...&lt;br&gt;
&lt;br&gt;
one of the solutions was outlined in this reply, which &lt;br&gt;
shows how to simulate mouse moves/clicks...&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://groups.google.com/group/comp.soft-&quot;&gt;http://groups.google.com/group/comp.soft-&lt;/a&gt;&lt;br&gt;
sys.matlab/msg/4bc21a262ac3a74f?dmode=source&lt;br&gt;
&lt;br&gt;
us</description>
    </item>
    <item>
      <pubDate>Tue, 18 Sep 2007 13:39:48 -0400</pubDate>
      <title>Re: How to generate mouse clicks to the Operating System?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/156064#392879</link>
      <author>Aoys </author>
      <description>Hello everbody, I have the same problem,&lt;br&gt;
&lt;br&gt;
I build a GUI and added a Listbox to it, now I have to &lt;br&gt;
click the right mouse button to choose some of the listbox &lt;br&gt;
items...My question: is it possible to do this right click &lt;br&gt;
of the mouse by writing a M-Code in matlab...and thanks in &lt;br&gt;
advance.. </description>
    </item>
  </channel>
</rss>

