You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if Processing for Android could wrap the APIs for detecting and processing user input from game controllers that are already included in the Android framework. They are not currently easily accessible in Processing for Android. Making these APIs accessible in Processing would enable developers to create interactive experiences using game controllers on Android devices, including the increasingly popular Android-based gaming handhelds from the likes of Anbernic or Retroid but also any kind of Android smartphone or tablet with a bluetooth controller plugged in.
Edit: An example of a Processing sketch running on an Anbernic 353V
Tl;dr: I'm struggling to find how to override the necessary callbacks (onGenericMotionEvent(), onKeyDown(), onKeyUp()) in the context of Processing since it instantiates the Activity and View itself.
Here's what I have managed so far:
Compile Processing examples to the device (specifically the RG353V, an Android-based handheld gaming console from Anbernic)
Use android.view.InputDevice to make a list of input devices and output their names to the console
Filter the input devices that are game controllers
Register an input device listener to receive notifications about when input devices are added, removed or changed using inputManager.registerInputDeviceListener()
Get the main activity with Activity activity = getActivity()
Get the root view with ViewGroup rootView = activity.findViewById(android.R.id.content);
I now want to capture button/joystick events but this is where my trouble starts.
All the examples I found involve implementing a custom view and overriding onGenericMotionEvent() for joystick events, and onKeyDown()/onKeyUp() for button events.
I was hoping to find something similar to registerInputDeviceListener() in the InputManager class or registerListener() in the SensorManager class, but I haven't found a method that would allow to register callbacks for button and joystick input in the InputDevice class in the same way.
It would be great if Processing for Android could wrap the APIs for detecting and processing user input from game controllers that are already included in the Android framework. They are not currently easily accessible in Processing for Android. Making these APIs accessible in Processing would enable developers to create interactive experiences using game controllers on Android devices, including the increasingly popular Android-based gaming handhelds from the likes of Anbernic or Retroid but also any kind of Android smartphone or tablet with a bluetooth controller plugged in.
Edit: An example of a Processing sketch running on an Anbernic 353V
References:
The text was updated successfully, but these errors were encountered: