Thanks for suggesions Jeff,
after chmod o+rwx /dev/input/js0 the joypad is initialized, but the number of available controllers is still 0:
(I didn’t use chmod for the other devices yet.)
java -Djinput.plugins=net.java.games.input.LinuxEnvironmentPlugin PollController 0 0
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
Getting the number of event devices
Getting 0 event devices
Getting the number of joystick devices
Getting 1 joystick devices
The provided index is out of range.
Use a value between 0 and -1
Using the su command, everything works fine (see output below) , but I receive the following message every time I hit a key:
Received event of type 0x04 from AT Translated Set 2 keyboard, which I wasn’t expecting, please report it to jinput forum at www.java-gaming.org
So is there anything other I can do than chmod[/chmod] and why do other applications (e.g. zsnes) can uses the joypad without these permissions ?
(Is that SDL specific ?)
[font=Courrier]
java -Djinput.plugins=net.java.games.input.LinuxEnvironmentPlugin ListControllers
Initing event interface
Device name for device file /dev/input/event0 is AT Translated Set 2 keyboard
Device name for device file /dev/input/event1 is PS/2 Mouse
Device name for device file /dev/input/event2 is AlpsPS/2 ALPS GlidePoint
Device name for device file /dev/input/event3 is GreenAsia Electronics 4Axes 12Keys GamePad
Device name for device file /dev/input/event4 is Microsoft Microsoft Wireless Optical Mouse� 1.0A
Copied temp event device 0 to event device 0
Copied temp event device 1 to event device 1
Copied temp event device 2 to event device 2
Copied temp event device 3 to event device 3
Copied temp event device 4 to event device 4
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
Getting the number of event devices
Getting 5 event devices
Getting the number of joystick devices
Getting 1 joystick devices
Getting device information for event device 0 and joystick 0
Getting device information for event device 1 and joystick 0
Getting device information for event device 2 and joystick 0
Getting device information for event device 3 and joystick 0
Getting device information for event device 4 and joystick 0
Gettign device name for jinput device 0.
jinput device 0 is 165973552
EventDevice::getName()
Gettign device name for jinput device 0, (AT Translated Set 2 keyboard)
EventDevice::getName()
Gettign number of absolute axes for jinput device 0 (0)
Gettign number of relative axes for jinput device 0 (2)
Gettign number of buttons for jinput device 0 (146)
Getting bus type for device 0
Getting suported relative axes for jinput device 0
Getting suported absolute axes for jinput device 0
Getting bus type for keyboard device 0
Gettign number of buttons for jinput keyboard device 0
LinuxNativeTypesMap.getButtonID() returned class net.java.games.input.Mouse$ButtonID
Gettign device name for jinput device 1.
jinput device 1 is 165976784
EventDevice::getName()
Gettign device name for jinput device 1, (PS/2 Mouse)
EventDevice::getName()
Gettign number of absolute axes for jinput device 1 (0)
Gettign number of relative axes for jinput device 1 (2)
Gettign number of buttons for jinput device 1 (3)
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 supported buttons for jinput device 1
Gettign device name for jinput device 2.
jinput device 2 is 165979160
EventDevice::getName()
Gettign device name for jinput device 2, (AlpsPS/2 ALPS GlidePoint)
EventDevice::getName()
Gettign number of absolute axes for jinput device 2 (3)
Gettign number of relative axes for jinput device 2 (2)
Gettign number of buttons for jinput device 2 (5)
Getting bus type for device 2
Getting supported buttons for jinput device 2
Getting suported relative axes for jinput device 2
Getting suported absolute axes for jinput device 2
Getting fuzz data for axis 0 on device 2
Getting absolute axes minimum value data for axis 0 on device 2
Getting absolute axes maximum value data for axis 0 on device 2
Getting fuzz data for axis 1 on device 2
Getting absolute axes minimum value data for axis 1 on device 2
Getting absolute axes maximum value data for axis 1 on device 2
Getting fuzz data for axis 2 on device 2
Getting absolute axes minimum value data for axis 2 on device 2
Getting absolute axes maximum value data for axis 2 on device 2
Getting supported buttons for jinput device 2
Gettign device name for jinput device 3.
jinput device 3 is 165981536
EventDevice::getName()
Gettign device name for jinput device 3, (GreenAsia Electronics 4Axes 12Keys GamePad )
EventDevice::getName()
Gettign number of absolute axes for jinput device 3 (12)
Gettign number of relative axes for jinput device 3 (0)
Gettign number of buttons for jinput device 3 (24)
Getting bus type for device 3
Getting supported buttons for jinput device 3
Getting suported relative axes for jinput device 3
Getting suported absolute axes for jinput device 3
Getting fuzz data for axis 0 on device 3
Getting absolute axes minimum value data for axis 0 on device 3
Getting absolute axes maximum value data for axis 0 on device 3
Getting fuzz data for axis 1 on device 3
Getting absolute axes minimum value data for axis 1 on device 3
Getting absolute axes maximum value data for axis 1 on device 3
Getting fuzz data for axis 2 on device 3
Getting absolute axes minimum value data for axis 2 on device 3
Getting absolute axes maximum value data for axis 2 on device 3
Getting fuzz data for axis 3 on device 3
Getting absolute axes minimum value data for axis 3 on device 3
Getting absolute axes maximum value data for axis 3 on device 3
Getting fuzz data for axis 4 on device 3
Getting absolute axes minimum value data for axis 4 on device 3
Getting absolute axes maximum value data for axis 4 on device 3
Getting fuzz data for axis 5 on device 3
Getting absolute axes minimum value data for axis 5 on device 3
Getting absolute axes maximum value data for axis 5 on device 3
Getting fuzz data for axis 6 on device 3
Getting absolute axes minimum value data for axis 6 on device 3
Getting absolute axes maximum value data for axis 6 on device 3
Getting fuzz data for axis 7 on device 3
Getting absolute axes minimum value data for axis 7 on device 3
Getting absolute axes maximum value data for axis 7 on device 3
Getting supported buttons for jinput device 3
Gettign device name for jinput device 4.
jinput device 4 is 165983912
EventDevice::getName()
Gettign device name for jinput device 4, (Microsoft Microsoft Wireless Optical Mouse� 1.0A)
EventDevice::getName()
Gettign number of absolute axes for jinput device 4 (0)
Gettign number of relative axes for jinput device 4 (5)
Gettign number of buttons for jinput device 4 (5)
Getting bus type for device 4
Getting supported buttons for jinput device 4
Getting suported relative axes for jinput device 4
Getting suported absolute axes for jinput device 4
Getting supported buttons for jinput device 4
0 - AT Translated Set 2 keyboard (buttons)
1 - PS/2 Mouse (mouse)
2 - AlpsPS/2 ALPS GlidePoint (mouse)
3 - GreenAsia Electronics 4Axes 12Keys GamePad (gamepad)
4 - Microsoft Microsoft Wireless Optical Mouse® 1.0A (mouse)