We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › Control mouse movement through processing
Page Index Toggle Pages: 1
Control mouse movement through processing (Read 831 times)
Control mouse movement through processing
Aug 31st, 2007, 11:34am
 
Is it possible to control the mouse via a serial input (such as an Arduino board) fed through processing? I wasn't sure if this was possible, but if anyone can enlighten me I would much appreciate it! Thanks.
Re: Control mouse movement through processing
Reply #1 - Aug 31st, 2007, 11:36am
 
Yes it is possible with the Java Robot class: http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Robot.html

However, be aware that you'll not be able to use this in sketches you export to the web, but if all you're doing is running a sketch locally, there should be no problem.
Re: Control mouse movement through processing
Reply #2 - Aug 31st, 2007, 11:46am
 
Thanks - the info is much appreciated. I am only intending on using this on my machine so that should cause no problem.
Re: Control mouse movement through processing
Reply #3 - Mar 29th, 2008, 11:55pm
 
John,
Do you know why it's not possible to use a sketch with a Robot on the web?  Is it a problem with Processing, Java, or the browser?
Re: Control mouse movement through processing
Reply #4 - Mar 30th, 2008, 12:58am
 
It's a Java security measure, to stop any old applet seizing your mouse and not letting go.

You can use it, but the applet has to be signed I think.
Page Index Toggle Pages: 1