Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (429)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (467)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Can't use latest distribution  (Read 1746 times)
0 Members and 1 Guest are viewing this topic.
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Posted 2008-02-07 22:11:04 »

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:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
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:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
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
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #1 - Posted 2008-02-07 23:46:14 »

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 Smiley

The controller text test reveals the extras for one of my machines as
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
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

Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #2 - Posted 2008-02-08 15:58:51 »

Thanks for the reply.

Here are the timestamps of the distribution files.


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
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #3 - Posted 2008-02-08 19:55:03 »

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

Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #4 - Posted 2008-02-09 12:22:16 »

Are you using a 64 bit distro by any chance?

Yes.

what kernel version,

2.6.22.16-0.1-default

what glib

2.14.1-4.2_x86_64 and the 32 bit compatibility layer

I am using Java 1.5.0_12

Thanks.

Marvin
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #5 - Posted 2008-02-09 16:07:47 »

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

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (81 views)
2014-04-15 18:08:23

BurntPizza (73 views)
2014-04-15 03:46:01

UprightPath (84 views)
2014-04-14 17:39:50

UprightPath (67 views)
2014-04-14 17:35:47

Porlus (84 views)
2014-04-14 15:48:38

tom_mai78101 (107 views)
2014-04-10 04:04:31

BurntPizza (167 views)
2014-04-08 23:06:04

tom_mai78101 (263 views)
2014-04-05 13:34:39

trollwarrior1 (214 views)
2014-04-04 12:06:45

CJLetsGame (223 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!