Can't use latest distribution

hi

I just downloaded the latest distribution from jinput.dev.java.net. So far I used the jar, which is distributed with LWJGL. Why do I need natives now even though I didn’t need any with the (supposed to be) older jar?

Anyway, my test code worked with the older jar and with the latest one (with correctly setup natives) I cannot run it anymore and get the following exception:


Loading: net.java.games.input.LinuxEnvironmentPlugin
java.lang.UnsatisfiedLinkError: nGetAxisMap
	at net.java.games.input.LinuxJoystickDevice.nGetAxisMap(Native Method)
	at net.java.games.input.LinuxJoystickDevice.getDeviceAxisMap(LinuxJoystickDevice.java:200)
	at net.java.games.input.LinuxJoystickDevice.<init>(LinuxJoystickDevice.java:70)
	at net.java.games.input.LinuxEnvironmentPlugin.enumerateJoystickControllers(LinuxEnvironmentPlugin.java:406)
	at net.java.games.input.LinuxEnvironmentPlugin.enumerateControllers(LinuxEnvironmentPlugin.java:233)
	at net.java.games.input.LinuxEnvironmentPlugin.<init>(LinuxEnvironmentPlugin.java:113)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
	at java.lang.Class.newInstance0(Class.java:350)
	at java.lang.Class.newInstance(Class.java:303)
	at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:157)
	at org.jagatoo.input.InputTest.main(InputTest.java:235)

This is my code:


net.java.games.input.Controller[] controllers = net.java.games.input.ControllerEnvironment.getDefaultEnvironment().getControllers();
//net.java.games.input.Controller[] controllers = net.java.games.input.RawInputEnvironmentPlugin.getDefaultEnvironment().getControllers();

for ( net.java.games.input.Controller controller: controllers )
{
    System.out.println( controller.getType() );
    System.out.println( controller.getComponents().length );
    if ( controller.getComponents().length == 144 ) // Keyboard
    {
        net.java.games.input.Event event = new net.java.games.input.Event();
        
        while ( true )
        {
            controller.poll();
            while ( controller.getEventQueue().getNextEvent( event ) )
            {
                System.out.println( event.getComponent().getIdentifier() + ", " + event.getValue() );
            }
        }
    }
}

btw. Another question. Why are there keyboards with only one component? Can I ignore them or are they supposed to be good for anything?

Thanks

Marvin

Looking at the jinput pages, it looks like java.net had an issue at some point. I don’t know what it was. The error you are seeing did happen in some older distributions. The distribution zip should have a time stamp of the 9th of Jan 2008. I’ve just checked it on two of my ubuntu servers and it’s playing nicely.

The other keyboards can be ignored if you want, mine are things like a sleep button, a power button (or two). I think they might be for when you have those buttons on a USB keyboard, but I’ve never tried pressing them as I don’t want to shut the machine done :slight_smile:

The controller text test reveals the extras for one of my machines as

Sleep Button (CM)
Type: Keyboard
Component Count: 1
Component 0: Sleep
    Identifier: Sleep
    ComponentType: Absolute Digital
---------------------------------
Power Button (CM)
Type: Keyboard
Component Count: 1
Component 0: Unknown
    Identifier: Unknown
    ComponentType: Absolute Digital
---------------------------------
Power Button (FF)
Type: Keyboard
Component Count: 1
Component 0: Unknown
    Identifier: Unknown
    ComponentType: Absolute Digital

HTH

Endolf

Thanks for the reply.

Here are the timestamps of the distribution files.

http://xith.org/jinput.png

Is it an automated build, that I have downloaded and will I have newer files with this bug fixed, if I download it again in the next days?

Marvin

Hi

That’s the newest build. They are not automated at all, I do them when something major is fixed. Are you using a 64 bit distro by any chance?, what kernel version, what glib version etc, I’m trying to figure out why what works on 2 of my machines, won’t work on yours.

Endolf

Yes.

2.6.22.16-0.1-default

2.14.1-4.2_x86_64 and the 32 bit compatibility layer

I am using Java 1.5.0_12

Thanks.

Marvin

I wonder if being 64 bit is the key. I have no 64 bit machines to test on unfortunately.

You should be able to build it from source as long as you have cvs, the jdk, ant and gcc

Endolf