The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
3D mouse support
Jared Maddox
Guest

Quote:
Date: Tue, 26 May 2015 17:45:34 +0000
From: "Astrophobia"
To:
Subject: Re: [SDL] 3D mouse support
Message-ID:
Content-Type: text/plain; charset="iso-8859-1"

I think I figured out what the JOYSTICK flag is. I was looking for it at the
wrong place, expecting it to be a Xorg setting. Turns out it should be set
before that, at udev level.
I now have an udev rule to ensures that the device gets

Code:
ENV{ID_INPUT_JOYSTICK}="1", ENV{ID_CLASS}="joystick"



Tada! SDL can now see my device Very Happy. But wait! There's still a (pretty big)
problem:

Quote:
Found 1 joystick(s)

Joystick Name: '3Dconnexion SpaceNavigator'
Joystick GUID: 030000006d04000026c6000011010000
Joystick Number: 0
Number of Axes: 0
Number of Buttons: 2
Number of Hats: 0
Number of Balls: 1
GameController:
not a gamepad


That's not quite correct. Yes, there are 2 buttons (which SDL seems to read
properly Smile ), but there should be 6 axes.
Instead, it reads 1 ball. The ball actually gives values from REL_X and
REL_Y, which I see as a good sign, but only read positive values (thought I
suspect this is just because that's what's expected from 'ball' inputs).

Quote:
From this thread (http://sourceforge.net/p/spacenav/mailman/message/27607490/),
I believe that in my case (I have an USB device), spacenavd should indeed
not be required.

Honestly, I would have given up if not for the fact that evtest taunts me by
reading from my device without any trouble. Well, at least I've learned more
about Xorg and udev, so that's good.

I'm currently looking into how to alter what SDL is reading when looking for
the number of axes, buttons, hats and balls (just in case the axes values are
there but not read). Any advice is welcome.


Just to make it clear, the last time that I checked SDL didn't support
6DOF input. If you want SDL to support it then you'll need to find a
way to add a new message that ALLOWS them to be supported. I would be
surprised if enough space is reliably available in the structure, so I
suggest two messages, one for the "high bits", and another for the
"low". If you're unwilling to do this, then I advise sticking with
either emulated-joystick behavior, or accessing it more directly.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org