From: Gaetan on
Hello,

I need to detect a left mouse click in an other application (ie. not in matlab instance).

Here is my problem : I can't find a solution with existing functions I know such as waitforbuttonpress, inputm functions, and others ... because it seems we need to be in a figure to use those functions.

What can I do ?

Use simulink ?
Use javascript ?

I hope my question is clear enough, english is not my first language.

Thanks,
G
From: Rune Allnor on
On 15 Feb, 17:50, "Gaetan " <gaetan.agne...(a)gmail.com> wrote:
> Hello,
>
> I need to detect a left mouse click in an other application (ie. not in matlab instance).
>
> Here is my problem :  I can't find a solution with existing functions I know such as waitforbuttonpress, inputm functions, and others ... because it seems we need to be in a figure to use those functions.
>
> What can I do ?

Probably not a lot. This would require you to intercept
the event scheduler in the operating system, redirecting
the mouse events from the other application into matlab.

So essentially, this is a spyware application.

I would be very surprised if matlab lets you as programmer
get access to the OS on the level required to pull something
like this off.

Rune
From: Gaetan on
Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <96096cc6-3bc6-4aec-a870-189bad2d791f(a)d2g2000yqa.googlegroups.com>...
> On 15 Feb, 17:50, "Gaetan " <gaetan.agne...(a)gmail.com> wrote:
> > Hello,
> >
> > I need to detect a left mouse click in an other application (ie. not in matlab instance).
> >
> > Here is my problem :  I can't find a solution with existing functions I know such as waitforbuttonpress, inputm functions, and others ... because it seems we need to be in a figure to use those functions.
> >
> > What can I do ?
>
> Probably not a lot. This would require you to intercept
> the event scheduler in the operating system, redirecting
> the mouse events from the other application into matlab.
>
> So essentially, this is a spyware application.
>
> I would be very surprised if matlab lets you as programmer
> get access to the OS on the level required to pull something
> like this off.
>
> Rune

Thank you for your answer. A spyware application ? its sounds like a 'malicious' application but this is absolutly not my intention. I just want to synchronize the execution of a m-file with an other application.

Gaetan
From: Gaetan on
"Gaetan " <gaetan.agneray(a)gmail.com> wrote in message <hlc5aa$mpb$1(a)fred.mathworks.com>...
> Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <96096cc6-3bc6-4aec-a870-189bad2d791f(a)d2g2000yqa.googlegroups.com>...
> > On 15 Feb, 17:50, "Gaetan " <gaetan.agne...(a)gmail.com> wrote:
> > > Hello,
> > >
> > > I need to detect a left mouse click in an other application (ie. not in matlab instance).
> > >
> > > Here is my problem :  I can't find a solution with existing functions I know such as waitforbuttonpress, inputm functions, and others ... because it seems we need to be in a figure to use those functions.
> > >
> > > What can I do ?
> >
> > Probably not a lot. This would require you to intercept
> > the event scheduler in the operating system, redirecting
> > the mouse events from the other application into matlab.
> >
> > So essentially, this is a spyware application.
> >
> > I would be very surprised if matlab lets you as programmer
> > get access to the OS on the level required to pull something
> > like this off.
> >
> > Rune
>
> Thank you for your answer. A spyware application ? its sounds like a 'malicious' application but this is absolutly not my intention. I just want to synchronize the execution of a m-file with an other application.
>
> Gaetan

Maybe I could see the problem from an other point of view :

Are we able to know if a figure f is focused ? I mean : Imagine I create a figure f, or use the function figure(f) to get the figure on top of all windows...the figure is then focused : can we get this state and detect when it's off ? (off : by clicking in an other application for example)
From: Walter Roberson on
Rune Allnor wrote:
> On 15 Feb, 17:50, "Gaetan " <gaetan.agne...(a)gmail.com> wrote:

>> I need to detect a left mouse click in an other application (ie. not in matlab instance).

>> Here is my problem : I can't find a solution with existing functions I know such as waitforbuttonpress, inputm functions, and others ... because it seems we need to be in a figure to use those functions.

>> What can I do ?

> Probably not a lot. This would require you to intercept
> the event scheduler in the operating system, redirecting
> the mouse events from the other application into matlab.

You might be able to get somewhere by using the Java robot class from within
Matlab. I've never looked at it myself so I don't know its limitations, but I
have seen several postings from people indicating they have been successful in
manipulating other applications in this manner.
 |  Next  |  Last
Pages: 1 2
Prev: Update string in listbox
Next: order zithromax pharmacy