Using 3DConnexions SpaceNavigator

OK. Success. The ControllerEventTest opens the window (screen dump attached).
java -Djava.library.path=dist -cp dist/jinput.jar:dist/jinput-test.jar net.java.games.input.test.ControllerEventTest
Trying to open /dev/input/event6
Got key of id 0
Got key of id 1
Got rel of id x
Got rel of id y
Got rel of id z
Got rel of id slider-velocity
Got rel of id slider-velocity
Got rel of id slider-velocity
Type guess from components: Mouse
Opened /dev/input/event6, found 3Dconnexion SpaceNavigator

Endolf, you can’t even get something as simple as mouse buttons sorted. The code clearly guesses at whats a mouse, so don’t assume that if JInput guesses it’s a mouse, that it is indeed a real mouse, with a real left mouse button. Spanner
Go back to playing games Endolf, you obviously can’t code for them :wink:

Trying to open /dev/input/event4
Got key of id Unknown
Type guess from components: Keyboard
Opened /dev/input/event4, found Power Button (FF)
Trying to open /dev/input/event5
Got key of id Sleep
Type guess from components: Keyboard
Opened /dev/input/event5, found Sleep Button (CM)
Trying to open /dev/input/event3
Type guess from components: Unknown
Opened /dev/input/event3, found PC Speaker

No clue what type PC Speaker is, we guessed at Unknown

Trying to open /dev/input/event1
Got key of id Escape
Got key of id 1
Got key of id 2
Got key of id 3
Got key of id 4
Got key of id 5
Got key of id 6
Got key of id 7
Got key of id 8
Got key of id 9
Got key of id 0
Got key of id -
Got key of id =
Got key of id Back
Got key of id Tab
Got key of id Q
Got key of id W
Got key of id E
Got key of id R
Got key of id T
Got key of id Y
Got key of id U
Got key of id I
Got key of id O
Got key of id P
Got key of id [
Got key of id ]
Got key of id Return
Got key of id Left Control
Got key of id A
Got key of id S
Got key of id D
Got key of id F
Got key of id G
Got key of id H
Got key of id J
Got key of id K
Got key of id L
Got key of id ;
Got key of id ’
Got key of id ~
Got key of id Left Shift
Got key of id
Got key of id Z
Got key of id X
Got key of id C
Got key of id V
Got key of id B
Got key of id N
Got key of id M
Got key of id ,
Got key of id .
Got key of id /
Got key of id Right Shift
Got key of id Multiply
Got key of id Left Alt
Got key of id
Got key of id Caps Lock
Got key of id F1
Got key of id F2
Got key of id F3
Got key of id F4
Got key of id F5
Got key of id F6
Got key of id F7
Got key of id F8
Got key of id F9
Got key of id F10
Got key of id Num Lock
Got key of id Scroll Lock
Got key of id Num 7
Got key of id Num 8
Got key of id Num 9
Got key of id Num -
Got key of id Num 4
Got key of id Num 5
Got key of id Num 6
Got key of id Num +
Got key of id Num 1
Got key of id Num 2
Got key of id Num 3
Got key of id Num 0
Got key of id Num .
Got key of id Unknown
Got key of id Unknown
Got key of id F11
Got key of id F12
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Num Enter
Got key of id Right Control
Got key of id Num /
Got key of id SysRq
Got key of id Right Alt
Got key of id Home
Got key of id Up
Got key of id Pg Up
Got key of id Left
Got key of id Right
Got key of id End
Got key of id Down
Got key of id Pg Down
Got key of id Insert
Got key of id Delete
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Num =
Got key of id Unknown
Got key of id Pause
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Sleep
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id Unknown
Got key of id F13
Got key of id F14
Got key of id F15
Got key of id Unknown
Got key of id Unknown
Type guess from components: Keyboard
Opened /dev/input/event1, found AT Translated Set 2 keyboard
Trying to open /dev/input/event2
Got key of id Left
Got key of id Right
Got key of id Middle
Got rel of id x
Got rel of id y
Got rel of id z
Type guess from components: Mouse
Opened /dev/input/event2, found HID 1241:1177
Trying to open /dev/input/event0
Got key of id Left
Got key of id Right
Got key of id Middle
Got rel of id x
Got rel of id y
Type guess from components: Mouse
Opened /dev/input/event0, found Macintosh mouse button emulation
Linux plugin claims to have found 6 controllers
Component count = 8
Component count = 1
Component count = 1
Component count = 144
Component count = 6
Component count = 5

There are two buttons on the device.

John

Excellent.

I’ll sort out a fix tonight and do a proper build.

Cheers

Endolf

Ok

Try this. If that works, perfect.

The combined dist of that can be found here

HTH

Endolf

Perfecto!!

One quick question. I remember seeing a set of instructions somewhere, on how to change the permissions on the devices to allow non root users to read the events. Can you tell me how to do it or point me to where this information is stored. I use webstart for my application (http://www.ejamaica.org/jroam/jroam.jnlp) and I will need to insert some code that on the linux platform calls some native script to change the permissions if they are not properly set.

John

Thanks again for your help.

If the user running the code does not already have permissions to the device, what makes you thing the will be able to change them?

Ubuntu for example. As root I had to change the udev config so that it gave group permissions to the /dev/input/event nodes for the user I run as.

Endolf

I was planning to check if the user had permission to read the /dev/input/event nodes, and if not then to popup a box for the user to enter the root password and then run a script that would change the permissions as root. This would only be done once.

John