On 04/11/2014 01:31 PM, Andreas Drewke [via jogamp] wrote:
> Hallo,
>
> Joysticks are supported in android by overriding "onGenericMotionEvent" in a
> activity.
>
> public boolean onGenericMotionEvent(final android.view.MotionEvent event)
>
> With my joystick no joystick event was ever fired to my JOGL based activiy, so
> I could not get this to work and I am not sure where the problem exists.
>
> Its said that one has to set up the focus for the view, but as JOGL doesn't
> export a view, so I can not do that.
Look at 'jogamp.newt.driver.android.WindowDriver'
where you can find
- public final SurfaceView getAndroidView()
See example
- com.jogamp.opengl.test.android.MovieSimpleActivity1
Yes, 'jogamp.newt.driver.android.WindowDriver' is a 'private' API class
and may change w/ any version by 'contract'.
However, this would only happen if it is reasonable and since developer
usually bundle JOGL on Android 'manually' not an issue.
Of course, I am all ears to enhance the Android impl. of the NEWT classes,
if you can make proposals (patch w/ tests ..) I like to merge those.
~Sven