Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JInput / Re: ControllerListeners ineffective ? on: 2007-01-22 11:43:48
Indeed, it does.
I don't know how I missed this one, sorry for the mess!   Embarrassed
2  Java Game APIs & Engines / JInput / Re: ControllerListeners ineffective ? on: 2007-01-18 21:10:35
All right, things are clear now...

After several tests, I finally noticed that the fix you were talking about was not included into the build I used (the latest available : jinput_combined_dist_20060514), since I got exactly the same exception as described in the other thread (when using the jinput test class) :
1  
2  
3  
4  
5  
6  
7  
java.lang.NullPointerException
   at net.java.games.input.DIControllers.getNextDeviceEvent(DIControllers.java:62)
   at net.java.games.input.DIAbstractController.getNextDeviceEvent(DIAbstractController.java:62)
   at net.java.games.input.AbstractController.poll(AbstractController.java:219)
   at net.java.games.input.test.ControllerWindow.poll(ControllerReadTest.java:230)
   at net.java.games.input.test.ControllerReadTest$1.run(ControllerReadTest.java:269)
   at java.lang.Thread.run(Unknown Source)


So I checkout the latest version from CVS and compiled it, and the NPE is not here anymore !
Thus I can confirm that your fix works properly.  Smiley

I was just not using the latest sources... My bad, sorry.

Thanks for your time,
Franck.
3  Java Game APIs & Engines / JInput / Re: ControllerListeners ineffective ? on: 2007-01-18 08:42:41
Ok, I'll check this evening and post the result.

Franck.
4  Java Game APIs & Engines / JInput / Re: ControllerListeners ineffective ? on: 2007-01-17 18:19:20
Good, glad to hear it's still being updated, as it's clearly the java API of choice to access controllers !

If I happen to find some strange behaviour I'll post them here in the future, it might be of use, then... Smiley

Well, actually, I already got an exception yesterday while playing with the library yesterday ; and from the top of my head it looks like the same problem as desribed in this thread : NullPointerException thrown from Poll() method (I'd have to check the exception stack to be sure).

Is this issue resolved in the last checkin yet?
If not, maybe I could be of use and provide you with any extra info / tests that could help regarding the problem ?

Cheers,
Franck.
5  Java Game APIs & Engines / JInput / Re: ControllerListeners ineffective ? on: 2007-01-17 13:34:33
Oh all right, no wonder then... Smiley
Thanks for the info, Endolf!

By the way, I was wondering if Jinput2 was still an active project, or if it has been discontinued?
6  Java Game APIs & Engines / JInput / ControllerListeners ineffective ? on: 2007-01-17 10:19:37
Hi,

I'm trying to use JInput2 (jinput_combined_dist_20060514) in an emulator project on Windows XP, but I'm currently experiencing some problems related to ControllerListeners : For some unknown reason, it seems that the ControllerListener I registered never get notified about added/removed controllers.

Moreover, the array returned by the getControllers() method is never updated (when I unplug a controller, it's still returned in this array, although the controller cannot be polled anymore - even if I plug it back )

For instance, when I run the following test case with, say, 2 controllers connected, then unplug one (or plug a new one), I get "Available controllers count : 2" print once, and nothing else...

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
import net.java.games.input.*;

public class TestListener
{
    static public void main( String[] args )
    {
        ControllerEnvironment env = ControllerEnvironment.getDefaultEnvironment();

        env.addControllerListener( new ControllerListener() {
            public void controllerRemoved( ControllerEvent e ) { System.out.println("REMOVED"); }
            public void controllerAdded  ( ControllerEvent e ) { System.out.println("ADDED"  ); }
        });

        int count = -1;

        for(;;) {
            int update = env.getControllers().length;
            if (count != update) {
                count = update;
                System.out.println( "Available controllers count : " + count );
            }
            try { Thread.sleep(200); } catch( InterruptedException e ) { /*empty*/ }
        }
    }
}


Did I do something wrong?

Thanks!
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Grunnt (16 views)
2014-09-23 14:38:19

radar3301 (14 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (29 views)
2014-09-20 20:14:06

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (75 views)
2014-09-10 13:57:51

TehJavaDev (105 views)
2014-09-10 06:39:09
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!