Jinput problems on Fedora 2

Hi. I’ve been trying to make JInput work but it doesn’t even recognize my controllers.
This is the .java I’m using:

import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment;

/** A simple application that lists the available

  • input controllers

  • @author Robert Schuster
    */
    public class ListControllers {

     /** Lists the available controllers
      *
      * @param args
      */
     public static void main(String[] args) {
             /* access the default controller environment
              * which contains all identified controllers
              */
             ControllerEnvironment ce =
                     ControllerEnvironment.getDefaultEnvironment();
    
             // retrieve the available controllers
             Controller[] controllers = ce.getControllers();
             System.out.println(controllers.length);
    
             // iterate through all controllers and show their index, name and type
             for (int i = 0; i < controllers.length; i++) {
                     System.out.println(
                             i
                                     + " - "
                                     + controllers[i].getName()
                                     + " ("
                                     + controllers[i].getType()
                                     + ")");
             }
     }
    

}

I’ve the same problem with Mandrake Official 10.1 and a Saitek P3000 USB gamepad.

with jinputTutorialOne, the command ant listControllers indicates that there’s a joystick device on /dev/input/js0.

With xxd, I’ve verified that the gamepad is on /dev/input/js0 but jinput seems not able to dial with it…

Hey this looks like my tutorial. :slight_smile:

You need to allow reading of /dev/input/eventXX files. For 2.4-kernels only USB-devices make a event-file. I am not used to Fedora (nor mandrake) but I am sure you can create those files with mknod and then it should work (see kernel documentation input/input.txt for information about the event files).

Ultimately I advise using a 2.6-kernel because you get mouse and keyboard support there, too.

@chlafaille: /dev/input/jsXX files are not used by the plugins (I guess this for endolf’s linux plugin, mine doesn’t thats for sure :slight_smile: ).

Hi, thanks for answering. It still doesn’t find any controllers.
I played it as root and didn’t work.
When you meant I should allow event* to be read you meant by giving permissions (chmod)?

Anyway, the only thing that I want from JInput is that the keyboard doesn’t have the keyboard delay of the system AWT has. Does anyone know how can I turn off that delay?

Thanks,
Ignacio.

Yes I meant giving permissions with chmod.

Please try ‘cat /dev/input/eventXY’ and move around your mouse, press keys. If the console is filled with garbage then everything is ok and JInput should be able to find the devices as well.

Sorry. No idea here.