Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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 failing to detect joypads on linux.  (Read 4230 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2005-10-28 11:57:41 »

As you know, LWJGL input is now a wrapper round JInput. Got this report recently:

http://lwjgl.org/forum/viewtopic.php?t=1237?

Is there some special setup required on a linux box to enable JInput to work? If so, is there a setup guide somewhere (wiki) ?

Kev

Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #1 - Posted 2005-10-28 17:12:49 »

Any chance of getting some of the log messages that jinput under linux spews out? Smiley

I suspect it has something to do with the fact that jinput looks under /dev/input for all the files, not /dev.

Each distro seems to layout /dev differently, just to confuse the issue.

I sence a patch to try reading /dev/input, then trying /dev for js devices if none are found in /dev/input.

I'd still like the logs to check Smiley

Endolf

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #2 - Posted 2005-10-28 21:02:45 »

where are the logs kepts?
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 2005-10-28 21:49:16 »

Thats up to javaws, it seems that there are a bunch of files in ~/.java/deployment/log under java 1.5

They are named nothing useful.

Endolf

Offline kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #4 - Posted 2005-10-29 08:08:47 »

The distro in question did indeed have the /dev/js - jinput checking both just seem to make sense.. maybe even configurable?

Not to pile on the work - but would it possible to catch the case where /dev/whatever can't be found and throw a bespoke exception (UnableToFindTheSoddingDeviceException ? Wink) so that users could detect it and display a sensible message "Please Move Your Devices around and break your distro"

Kev

Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #5 - Posted 2005-10-30 21:57:02 »

Updates done but not yet tested for checking /dev after /dev/input

First attempt at freeing some of the memory from the init processes

No longer read the 0th element if no device files are found.

No exception yet for kev Smiley

Endolf

Offline kevglass

JGO Kernel


Medals: 159
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #6 - Posted 2005-11-03 14:22:12 »

Are these builds available somewhere?

You pointed at me via IM but they don't seem to have natives in?

Kev

Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #7 - Posted 2005-11-03 19:14:48 »

http://www.newdawnsoftware.com/resources/jinput/jinput_linux_2005_10_31.tgz

also linked on jinput.dev.java.net

HTH

Endolf

Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #8 - Posted 2005-11-03 22:09:22 »

Hi

With the help of kappaOne the issue is known. I'm away this weekend, but I hope to look at it whilst away and commit changes monday.

Endolf

P.S.

Endolf, in case you are reading this over the weekend and have forgotten what the issue is, you are ignoring joysticks that don't have an event device with them.

P.P.S. was that intentional due to some nastyness with joysticks???

P.P.P.S. Take your gamepad with you to test over the weekend

Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #9 - Posted 2005-11-06 10:54:08 »

Hi

I think it's done, I don't have a net con from linux in the hotel, so it'll have to wait till tonight for a build to be uploaded and tested.

Endolf

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 #10 - Posted 2005-11-07 21:55:49 »

Webstart demo updated

new d/l here

Endolf

P.S. Expect it to sigsegv, if it does, please send me the whole output.

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #11 - Posted 2005-11-08 21:55:03 »

ok still failing to get the joypad detected properly but is moving a step closer to working, heres the latest output

native output
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
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
Copying joystick device 0 to jinput device list 0


jws output (btw this is with Typhoon game)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
creating input stuff
OS name is: Linux
Linux plugin is supported
OS name is: Linux
Linux plugin is supported
Initing JInputLibrary
Shutdown thread created and run
OS name is: Linux
Linux plugin is supported
0 Controllers Found
Waiting on monitor
800 x 600 x 24 @60Hz


oh btw no need to worry about uploading natives everytime now, cos i found a easy way to get native output when using java webstart, if you just run the jnlp through a console, native output comes on the console window and java webstart output on the java console.
Offline dwithers

Junior Newbie





« Reply #12 - Posted 2005-11-11 16:01:38 »

Hi all,

I was trying JInput on Linux and came across this thread when trying to resolve the same problem. I noticed that the joystick appears to be detected, but not until my program has exited. I've got test code and its output, which I've attached to this post.

It was run on a Slackware 10.2 system with JDK 1.5.0_04 and one joystick on /dev/input/js0. I hope it helps.
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #13 - Posted 2005-11-11 20:14:30 »

Hi

New webstart version and new build here.

Endolf

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #14 - Posted 2005-11-11 20:57:33 »

ok good news just tried JInput through JWS and it works

native code
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
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
Copying joystick device 0 to jinput device list 0
Gettign device name for jinput device 0.
jinput device 0 is 135050352
Gettign device name for jinput device 0, (SAITEK Tournament Pad)
Gettign number of absolute axes for jinput device 0 (3)
Gettign number of relative axes for jinput device 0 (0)
Gettign number of buttons for jinput device 0 (8)
Getting bus type for device 0
Getting supported buttons for jinput device 0
Getting suported relative axes for jinput device 0
Getting suported absolute axes for jinput device 0
Getting fuzz data for axis 0 on device 0
Getting absolute axes minimum value data for axis 0 on device 0
Getting absolute axes maximum value data for axis 0 on device 0
Getting fuzz data for axis 1 on device 0
Getting absolute axes minimum value data for axis 1 on device 0
Getting absolute axes maximum value data for axis 1 on device 0
Getting fuzz data for axis 2 on device 0
Getting absolute axes minimum value data for axis 2 on device 0
Getting absolute axes maximum value data for axis 2 on device 0
Getting supported buttons for jinput device 0
Getting FFEnabled status for device 0


java console output
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
OS name is: Linux
Linux plugin is supported
OS name is: Linux
Linux plugin is supported
Initing JInputLibrary
Shutdown thread created and run
Java working on device SAITEK Tournament Pad
Java code thinks FF is disabled for device SAITEK Tournament Pad
Linux plugin claims to have found 1 controllers
Component count = 11
Waiting on monitor


works great and detects all the buttons, however just one thing when i run the jws two windows pop up one with the title SAITEK Tournement Pad and another blank window with title Controller Read Test, is this normal?

good work on getting it up and running! Smiley
Offline chrisw1229

Senior Newbie





« Reply #15 - Posted 2005-11-12 06:34:13 »

Yes the 2 windows are normal from my experience.  The test program creates 1 window for each device it detects and one window as the main parent window.  So if you close the blank window it closes all the other ones and shutsdown the program.
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #16 - Posted 2005-11-12 16:54:18 »

Hi

Kev's spot on, it does indeed open a window per device and the main one. If it detects a mouse it will open 3 for that device, one for the main mouse, one for the ball and one for the buttons.

If you feel brave enough, compile a kernel with the event interface enabled and you mouse, keyboard, joystick, and anything else plugged in will show up. If you have a USB scanner with 3 buttons for example, jinput will detect it and allow you to use the buttons in a game Smiley

Endolf

Offline Jeff

JGO Coder




Got any cats?


« Reply #17 - Posted 2005-11-13 02:07:16 »

Yes thats normal.

Just my quick and crappy programming on the demo Smiley

The mainf rame is there so you can end the app by closing it.

Each controlelr then gets its own frame.

JK

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline dwithers

Junior Newbie





« Reply #18 - Posted 2005-11-14 20:36:03 »

The new build works perfectly for me as well. Thanks!  Grin
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.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (32 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (40 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
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!