Re: JInput integration in NEWT?

Posted by Michael Bien on
URL: https://forum.jogamp.org/JInput-integration-in-NEWT-tp3319982p3325387.html

On 09/10/2011 12:35 PM, Sven Gothel [via jogamp] wrote:
>
> For sure all good ideas.
>
> IMHO the fasted way to just get joystick and gamepad going
> is the above mentioned one (1).
> So anybody pls .. I would need your expertise for such native input APIs
> and maybe a few native code examples. THANK YOU.

pushing controller state directly into the event dispatcher could be a
nice feature, however it wouldn't be that useful for many realtime
applications (games etc). Usually you would like to have three things:
  - a proper controller abstraction (.listControllers(),
controller.getAxisX() etc)
  - a polling mechanism to receive all events which happened while the
engine was rendering the frame
  - sometimes you even don't care about the event history, all you want
is the current state of the controller. e.g. joystic.throttle.value

jinput solves this quite nicely, you can poll each Axis of a mouse,
joystic etc. On linux its a bit problematic since the application has
usually no read access to the /dev/input files, however in this case you
can let jinput use the awt fallback which gives you at least kb and mouse.

so basically what Julien suggested would be most "effective" IMO. A
jinput plugin which uses newt as fallback instead of awt (to workaround
the /dev/input issue).

(and there is also output for force feedback controllers)

regards,
michael


>
>
> >
> > Best regards.
>
>
> ~Sven
>