Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (532)
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  
  Jinput problems on Fedora 2  (Read 1409 times)
0 Members and 1 Guest are viewing this topic.
Offline IgnacioZ

Junior Newbie




Java games rock!


« Posted 2005-01-04 20:04:37 »

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.getName()
                                       + " ("
                                       + controllers.getType()
                                       + ")");
               }
       }

}

Offline chlafaille

Innocent Bystander




Java games rock!


« Reply #1 - Posted 2005-01-10 20:27:56 »

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...
Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #2 - Posted 2005-01-14 15:18:17 »

Hey this looks like my tutorial. :-)

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 Smiley ).


cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline IgnacioZ

Junior Newbie




Java games rock!


« Reply #3 - Posted 2005-01-15 17:20:14 »

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.
Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #4 - Posted 2005-01-16 17:49:29 »

Quote

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)?

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.

Quote

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?

Sorry. No idea here.

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
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.

pw (15 views)
2014-07-24 01:59:36

Riven (15 views)
2014-07-23 21:16:32

Riven (13 views)
2014-07-23 21:07:15

Riven (15 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (40 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (51 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!