I am looking to teach how to implement the above in Processing 4 and seems the Game Control Plus Library is not functional in Processing 4. I can’t see any alternative way to get simple input from such devices into Processing. Question – will this library ever be updated to work in Processing 4 or does anyone have any alternative and simple cross platform workflows for this?
I will not be updating this library for V4 because the low level code was created by someone else and is very, very old technology. You can read more about it on my website lagers.org.uk
Hi Peter! Many thanks for getting back and confirming. I did read your site and appreciate it is built on ancient code. No problem – I understand – just needed confirmation. So there is no alternative you know to easily implementing USB game controllers in modern Processing? If not (can’t believe nobody uses external controllers in Processing in 2025!) I’m tempted to created a general purpose standalone Processing 3 background helper app to hand off user input from your library and send via OSC – although I had difficulty in trying to get your library to silently load the configuration on start – any pointers?
I suspect one of the problems is that reading USB devices is OS / hardware specific and the original author created / provided the low level system libraries for Windows, OSX and Linux.
Replacing these with modern versions is well beyond anything I could do. It might be worth searching for suitable libraries and create a Java wrapper app.
The ControlIO
class provides the getMatchedDeviceSilent(...)
and I have just looked at the source code and cannot see any console output statements so I am not sure what output you are getting. Perhaps you could copy the outp message here?
// works but have to manually link each launch
gpad = control.filter(GCP.GAMEPAD).getMatchedDevice("gamecontrollerInput01");
// I took this from a previous post on the forum, and hacked it to try to make work
// but this bit: Configuration.makeConfiguration(app, "gamecontrollerInput01")); is wrong – don't know what 'app' should be and generally confused as to implementation
gpad = control.filter(GCP.GAMEPAD).getMatchedDeviceSilent(Configuration.makeConfiguration(app, "gamecontrollerInput01"));
I assume gamecontrollerInput01
is the name of the configuration file. The problem is if can’t find a matched device then it will launch the configurator so you can select and configure a different device.
If you use
gpad = control.filter(GCP.GAMEPAD).getMatchedDeviceSilent("gamecontrollerInput01");
gpad
will be null
if a matched device can’t be found and the configurator will not be called (hence silent). In that situation the user has to decide what to do.
Configuration.makeConfiguration(app, "gamecontrollerInput01");
This will launch the configurator to create a new configuration based an existing configuration file. Basically called if it can’t find a matched device (non silent mode). The method returns a Configuration object which can be saved to file with the saveConfiguration
method
The parameter app
is the Processing applet object so when calling this method from your sketch code it should have the value this
I haven’t tried it but you might have some luck with JInput.
Thanks for this info – I haven’t had a chance to try your suggestion but it looks straightforward enough.
Update – I wrote a simple Processing 3 sketch and compiled to runtime application which simply gets input from the connected input device and forwards it to OSC (using oscP5 library). This allows me to look for OSC input from it in Processing 4 and map to variables there. It works well and is my workaround hack for the moment! It’s clearly silly to have a standalone runtime app only doing a simple input/output but I’m just happy to be able to control sketches in Processing 4 with a gamepad! Thanks again for your help and for your original work on the library