Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 2378 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 ( 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 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
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
Exp: 15 years

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.


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
Pages: [1]
  ignore  |  Print  

EgonOlsen (77 views)
2018-06-10 19:43:48

EgonOlsen (57 views)
2018-06-10 19:43:44

EgonOlsen (77 views)
2018-06-10 19:43:20

DesertCoockie (259 views)
2018-05-13 18:23:11

nelsongames (157 views)
2018-04-24 18:15:36

nelsongames (156 views)
2018-04-24 18:14:32

ivj94 (897 views)
2018-03-24 14:47:39

ivj94 (161 views)
2018-03-24 14:46:31

ivj94 (810 views)
2018-03-24 14:43:53

Solater (174 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!