Prev: Update string in listbox
Next: order zithromax pharmacy
From: Gaetan on 15 Feb 2010 11:53 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 15 Feb 2010 11:57 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 15 Feb 2010 13:55 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 15 Feb 2010 14:41 "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 15 Feb 2010 15:20
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. |