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 & HelpPrograms › Background process daemon
Page Index Toggle Pages: 1
Background process daemon? (Read 1655 times)
Background process daemon?
Mar 6th, 2010, 11:42am
 
I'm trying to create a Processing program that uses the Robot class to send key events (which are then picked up by AutoHotKey to run commands on my Win7 machine) and now I'd like to create a program that runs as a background process and does this work.

I know I can use msconfig to start a program or file up when Windows logs in but I was wondering how I can create a program that does not require an applet window to be opened to run (maybe just a system tray icon would be nice though). Has anyone done this or seen this with Processing/Java?
Re: Background process daemon?
Reply #1 - Mar 6th, 2010, 12:51pm
 
Looks like a convoluted process... I don't see why you would use a graphical, heavy application like Processing to run hidden and do non-graphical things...
Why you don't just use AutoHotkey itself? It is well suited for this task and much lighter.
Re: Background process daemon?
Reply #2 - Mar 6th, 2010, 5:11pm
 
Because AutoHotKey cannot interpret serial data from an Arduino. I'm actually trying to use an Arduino as a physical input device to send commands to a computer and have the computer do actions based on the input.

But Arduino can't really output keyboard commands directly without some pretty wonky PS/2 code so I figured using Processing as an interpreter would help. You're right that its probably not a good application to use in this case, but it just works with Arduino so well I didn't want to spend too much time messing around.
Re: Background process daemon?
Reply #3 - Mar 7th, 2010, 2:32am
 
h4t wrote on Mar 6th, 2010, 5:11pm:
Because AutoHotKey cannot interpret serial data from an Arduino.

It can, since it can call Windows API functions. But it needs some knowledge of the serial port API, and some research. Never tried this.
I think you can't run Processing without having a window showing, but perhaps you can hide it after that. Java 1.6 also allows to display an icon in the system tray.
Re: Background process daemon?
Reply #4 - Mar 7th, 2010, 8:46am
 
Whoa, didn't know AHK could do that. That little app is full of surprises, lol. Thanks.
Re: Background process daemon?
Reply #5 - Mar 7th, 2010, 9:10am
 
If you know the serial API of Windows, look at DllCall in AHK's help file.
Re: Background process daemon?
Reply #6 - Mar 8th, 2010, 7:19am
 
AHK's solution looks pretty difficult, here is the solution I have started using with good results:
http://www.aacinstitute.org/downloads/aackeys/AACKeys.html

Just output the key commands directly from Arduino via serial and they get executed perfectly. Cool program.
Page Index Toggle Pages: 1