processing in background recording movements and actions

edited December 2017 in How To...

Hi , I´d like to know how to put the processing in the background recording my actions in other software. The ideia is record in real time keyboard and mouse movements. Others programs do this, like Macrorecorder but with processing I want to transform action in graphic information.

Tagged:

Answers

  • edited December 2017

    I believe that you cannot do this with the default Processing API -- it isn't designed to "hear" mouse clicks or key presses when the sketch is out of focus.

    This may be possible in Java, depending on the security settings on your computer -- while there are legitimate uses for macro recorders, many "keyloggers" are considered malware, as they can be used to steal passwords and invade people's privacy.

    If you don't need real-time inputs, then you can use macro recording software that writes a log file, then have your Processing sketch load the log file and act on the data to draw something. See for example this recent discussion:

    https://forum.processing.org/two/discussion/comment/110960/#Comment_110960

    Otherwise you might want a third-party key/mouse listener and livestreamer that pipes the data over some standard protocol that a Processing sketch can listen to -- e.g. OSC. You could try to write that listener yourself in Java, but it might be quite hard to do, and I wouldn't necessarily recommend doing it in Processing.

    Can other forum members think of past examples of live-streaming desktop keyboard / mouse data to a (remote) sketch?

  • Thanks Jeremy. I will try load a .txt log file in processing using loadString and/or loadTable.

Sign In or Register to comment.