Attaching directly to raw user input in library.

Hi all.

How can one build a Processing library that directly connects into the raw user input feed, as opposed to connecting to the standard Processing handlers?

I am the writer of Hermes, a game engine for Processing. The concept behind the library is to build out a game engine system with the Processing drawing API used for rendering, but with our library handling the core game loop, threading model, entity system and input handling (to merge both user and network input). To accomplish the last point, we obtained access to the root Applet object and attached our input handler for mouse and keyboard directly to it. Attaching to the Processing handler didn't work, as the Processing handler queued events to synchronize with rendering; we needed events to go to an entirely different "logic" thread, which needs its own layer of queueing. Stacking the two two layers of buffering, adding latency to input handling.

This, of course, has broken with the change to Processing v3, where Applet is no longer used. However, I haven't quite figured out what's happening with the user input and how to get direct access to it.

Any tips would be appreciated, including that this is no longer possible.


Sign In or Register to comment.