LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: WibbleMan on April 18, 2008, 15:31:20

Title: re "Create" controllers
Post by: WibbleMan on April 18, 2008, 15:31:20
Hi, I'm new to this lark.

I'm a student using lwjgl to attach a Guitar hero guitar to a music program I'm writing (windows).

Everything works fine but some time after I've used:
           Controllers.create();

I want to be able to be able to update the Controllers with their current state.
I was wondering if there was a way.  Controllers.destroy() doesn't achieve this.

Any ideas out there?

Thanks!
Title: Re: re "Create" controllers
Post by: gaarazero on April 18, 2008, 17:34:41
Quote from: WibbleMan on April 18, 2008, 15:31:20
I'm a student using lwjgl to attach a Guitar hero guitar to a music program I'm writing (windows).
Cool :).

When you check the input, use:

Controllers.poll();
while( Controllers.next() ) {
// Read the state of the controllers (i.e. Controllers.getEventSource(), etc.)
}


-gz
Title: Re: re "Create" controllers
Post by: WibbleMan on April 19, 2008, 07:38:23
Aha, I hven't tried that.

Will that detect if I've plugged in/removed a controller since using the
         Controllers.create();
command then?

Thanks
Title: Re: re "Create" controllers
Post by: Fool Running on April 22, 2008, 15:42:21
Almost every program needs to have the controller attached before it starts; LWJGL is one of those to my knowledge.
I would say most users should be able to understand this, so not detecting it at runtime should be fine.
Title: Re: re "Create" controllers
Post by: Qudus on July 12, 2008, 13:04:11
It's not LWJGL's fault. LWJGL just uses JInput, which currently doesn't support hot-plug-detection. I posted this issue on javagaming.org (http://www.javagaming.org/index.php/topic,18592.0.html) some time ago. They will hopefully implement it soon.

Marvin