Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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  
  Linux - problems detecting information about components  (Read 1617 times)
0 Members and 1 Guest are viewing this topic.
Offline Conzar

Junior Member




There is nothing common about common sense


« Posted 2006-04-12 00:41:25 »

Hello.  I am using the following version of jinput:
jinput_linux_2005-12-04.tgz
java version = 1.5.0_06 from Sun
Running 2.6.15 under gentoo with gcc 3.4.5

Output of ControllerReadTest is below.
Everything about the component is null except for the value of it (take a button, it reports off or on but it does not report its name).

I am running the test with the following where everything is in the current directory.
1  
java -Djava.library.path=. -classpath .:jinput.jar net.java.games.input.test.ControllerReadTest



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  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
OS name is: Linux
Linux plugin is supported
OS name is: Linux
Linux plugin is supported
Initing JInputLibrary
Shutdown thread created and run
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
Opened /dev/input/js1, trying to get device name
Getting button and axes information for /dev/input/js1
Initialisation of /dev/input/js1 completed
Getting the number of event devices
Getting 0 event devices
Getting the number of joystick devices
Getting 2 joystick devices
Copying joystick device 0 to jinput device list 0
Copying joystick device 1 to jinput device list 1
Waiting on monitor
Gettign device name for jinput device 0.
jinput device 0 is 136168360
Gettign device name for jinput device 0, (Saitek Saitek X45)
Gettign number of absolute axes for jinput device 0 (8)
Gettign number of relative axes for jinput device 0 (0)
Gettign number of buttons for jinput device 0 (26)
Java working on device Saitek Saitek X45
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 fuzz data for axis 3 on device 0
Getting absolute axes minimum value data for axis 3 on device 0
Getting absolute axes maximum value data for axis 3 on device 0
Getting fuzz data for axis 4 on device 0
Getting absolute axes minimum value data for axis 4 on device 0
Getting absolute axes maximum value data for axis 4 on device 0
Getting fuzz data for axis 5 on device 0
Getting absolute axes minimum value data for axis 5 on device 0
Getting absolute axes maximum value data for axis 5 on device 0
Getting fuzz data for axis 6 on device 0
Getting absolute axes minimum value data for axis 6 on device 0
Getting absolute axes maximum value data for axis 6 on device 0
Getting fuzz data for axis 7 on device 0
Getting absolute axes minimum value data for axis 7 on device 0
Getting absolute axes maximum value data for axis 7 on device 0
Getting supported buttons for jinput device 0
Getting FFEnabled status for device 0
Java code thinks FF is disabled for device Saitek Saitek X45
Gettign device name for jinput device 1.
jinput device 1 is 136165296
Gettign device name for jinput device 1, (Logitech Logitech(R) Precision(TM) Gamepad)
Gettign number of absolute axes for jinput device 1 (2)
Gettign number of relative axes for jinput device 1 (0)
Gettign number of buttons for jinput device 1 (10)
Java working on device Logitech Logitech(R) Precision(TM) Gamepad
Getting bus type for device 1
Getting supported buttons for jinput device 1
Getting suported relative axes for jinput device 1
Getting suported absolute axes for jinput device 1
Getting fuzz data for axis 0 on device 1
Getting absolute axes minimum value data for axis 0 on device 1
Getting absolute axes maximum value data for axis 0 on device 1
Getting fuzz data for axis 1 on device 1
Getting absolute axes minimum value data for axis 1 on device 1
Getting absolute axes maximum value data for axis 1 on device 1
Getting supported buttons for jinput device 1
Getting FFEnabled status for device 1
Java code thinks FF is disabled for device Logitech Logitech(R) Precision(TM) Gamepad
Linux plugin claims to have found 2 controllers
Component count = 34
Component count = 12

Ubuntu
Offline Conzar

Junior Member




There is nothing common about common sense


« Reply #1 - Posted 2006-04-12 00:47:59 »

So it seems that there is a permissions problem.  If I run that very same program as root, then I get all the button names.
Looks like when I look at /dev/input/js* root owns them with read privildeges by everyone but no write.

So does anyone know how to change the group (chgrp) to js* when they are added to the system (since they go away when u unplug and replug the controllers, I don't want to have to manually change the group to give myself priveldges).  Btw, the group I will be using is games.

Ubuntu
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #2 - Posted 2006-04-12 11:20:31 »

Hi

The permissions thing is something I keep failing to resolve under ubuntu too. I've for a FF controller so I need to write the events.

Endolf

P.S. Have you tried jinput2 beta builds?

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Conzar

Junior Member




There is nothing common about common sense


« Reply #3 - Posted 2007-04-28 03:46:07 »

OK.  So I found a topic on this in the gentoo forums.  Looks like the best way of handling permissions is to use the udev rules system.
udev is a 2.6 kernel feature, so not sure what the 2.4 folks will do.

Here is an easy way for folks to get the right permissions on their usb gamepads and joysticks.

Add the following line to /etc/udev/rules.d/10-local.rules (if it doesn't exist, then create it).
1  
SUBSYSTEM=="input", GROUP="games", MODE="770"


you can run udevstart which should change the permissions.  I think a restart might be in order too.


Sources on udev:
http://www.reactivated.net/writing_udev_rules.html
http://gentoo-wiki.com/UDEV

Ubuntu
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.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (43 views)
2014-09-23 14:38:19

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

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

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

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

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

BurntPizza (54 views)
2014-09-19 03:14:18
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!