Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (562)
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  
  State of Linux plugin  (Read 1475 times)
0 Members and 1 Guest are viewing this topic.
Offline gilead

Senior Newbie





« Posted 2004-08-24 19:33:29 »

I tried to use JInput with gamepad on Linux (kernel 2.4) with no success (and as I read it's not yet really done, correct?). Everything here is set up properly and I can use the pad with Joystick Driver for Java (http://sourceforge.net/projects/javajoystick/). How are things? Is there any progress in this area (there are no changes in CVS for a few months)? Any expectations about where Linux plugin will work? Can someone with very limited C knowledge be of any help?
Offline gilead

Senior Newbie





« Reply #1 - Posted 2004-08-24 20:06:26 »

OK, now I'm not sure if Linux plugin is really unfinished as I saw two gamepad entries on the HCL for Linux marked as OK. So I add one more question: how to debug the pad (USB MediaTech MT160 Dual Shock) which doesn't work with JInput? I know it's working fine in all testing apps, cat /dev/input/js0 shows expected garbage and http://sourceforge.net/projects/javajoystick/ works fine so I think it's JInput's problem.
Offline gilead

Senior Newbie





« Reply #2 - Posted 2004-08-24 20:49:24 »

Great, answering myself  Wink

I made some progress, now when I run ControllerReadTest I get:

Scanning jar: linux.jar
Examining file : META-INF/
Examining file : META-INF/MANIFEST.MF
Examining file : net/
Examining file : net/java/
Examining file : net/java/games/
Examining file : net/java/games/input/
Examining file : net/java/games/input/LinuxDevice$LinuxHat.class
Examining file : net/java/games/input/LinuxDevice$ButtonID.class
Examining file : net/java/games/input/LinuxDevice$1.class
Examining file : net/java/games/input/LinuxDevice.class
Examining file : net/java/games/input/LinuxAxis.class
Examining file : net/java/games/input/LinuxEnvironmentPlugin.class
Found candidate class: net/java/games/input/LinuxEnvironmentPlugin.class
Adding class to plugins:net.java.games.input.LinuxEnvironmentPlugin
Examining file : net/java/games/input/LinuxKeyboard$KeyID.class
Examining file : net/java/games/input/LinuxKeyboard.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseBall.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseButtons.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseButton.class
Examining file : net/java/games/input/LinuxMouse.class
Examining file : net/java/games/input/LinuxNativeTypesMap.class
Examining file : net/java/games/input/NativeDefinitions.class
Initing event interface
Initing joystick interface
Trying to open /dev/input/js0
Opened /dev/input/js0, trying to get device name
Getting button and axes information for /dev/input/js0
Initialisation of /dev/input/js0 completed
Trying to open /dev/input/js1
Failed to open device /dev/input/js1
Trying to open /dev/input/js2
Failed to open device /dev/input/js2
Trying to open /dev/input/js3
Failed to open device /dev/input/js3
Getting the number of event devices
Getting 0 event devices
Getting the number of joystick devices
Getting 1 joystick devices

So the pad seems to be detected, yet it's not showing itself on the getControllers() list... hm... Huh

BTW, I don't want to whine but having to put plugin exactly in controller/ directory Shocked is about to be the perfect unintuitive way of doing it. I managed to find its rationale which sounds good but then I think it has two serious problems as it is now:
* it should be clearly described in the bold big red flashing letters in the README
* JInput should issue an error, or *at least* a clear warning if it doesn't find any plugins -- error message should also contain information about controller/ directory

I think I'll write a short beginner's guide for linux users when/if I manage to do make JInput work  Cheesy
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gilead

Senior Newbie





« Reply #3 - Posted 2004-08-24 21:35:47 »

Well, I think I'm stuck here. With 0 event devices the joystick device isn't going to be processed by loop at line 84 in file jinput.cpp -- at least I think that's where the problem is.

Any help will be very appreciated.
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #4 - Posted 2004-08-26 10:22:33 »

Ok, as this is a USB device it *should* work. You should get devices listed in /dev/input/ called event*, these should be read/write to the user running the app. I've never tried it on a 2.4 kerne though.

Endolf

Offline gilead

Senior Newbie





« Reply #5 - Posted 2004-08-26 20:08:13 »

Ahhh, mentioning the /dev/input/event* devices was key to success Smiley Changing their permissions fixed the problem.

I posted small patch which fixes Linux 2.4 problems, please see https://jinput.dev.java.net/issues/show_bug.cgi?id=31
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.

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

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

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

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

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

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

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

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

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
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!