input-evdev patch adding option to override XDevice type Atom, option to force EV_REL events being treated as absolute values.

Wolfgang Draxinger wdraxinger at darkstargames.de
Mon Mar 10 16:51:50 PDT 2008


Hi there,

last week I got one of those nifty spaceballs from 3Dconnexion and 
started implementing support for Blender. There's been another 
project with the same goal, and my first attempts to use it failed. 
For two simple reasons: The Linux Event API doesn't tell us, what 
kind of device is connected, other than product and vendor ID* so 
evdev simply uses the atom MOUSE for everything that provides 
valuators. Since a spaceball is not a mouse and the type Atom is 
simply a string I figured it might be a good idea, to have an option 
to override the atom determined by the initialization code.
Option "ForceType" "whatever"
  *) Actually I think it might be a good idea to have such as a option 
of the X.Org core, so that this can be done with all input devices.

The other problem I had was, that the 3Dconnextion SpaceNavigator 
sends relative motion events (already in the USB-HID protocol) and 
Linux just passes this on. However technically a spaceball is a "6DOF 
joystick", which generates absolute values. Since the Linux kernel 
can't tell if the stuff sent by USB-HID devices is what it should be, 
it's upon the program reading the events (i.e. the X.Org driver), to 
process them correctly. So another option
Option "ForceAbsolute" "True|False"
which will make EV_REL events generate absolute motion events.

Now the spaceball XDevice behaves like expected, if I set both options 
for the specific device (using product and vendor ID).

As a further suggestion, I'd like to throw in the idea of a device 
database that ships with input-evdev, from which it reads device 
parameters (like ForceType, ForceAbsolute) based on the IDs reported 
from the OS.

I attached a patch with my additions to xf86-input-evdev-1.1.5, and 
I'd be really happy if this could make it into the official X.Org. 
The 3Dconnexion devices are getting very popular lately and I don't 
see any other way to sanely support them. Also there's already other 
X11 software with spaceball support, which immediately benefits, too.

Greetings
-- 
Wolfgang Draxinger
lead programmer - DARKSTARgames
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xf86-input-evdev-1.1.5-forced_absolute_and_type.patch
Type: text/x-diff
Size: 8338 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20080311/356c158e/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.x.org/archives/xorg/attachments/20080311/356c158e/attachment.pgp>


More information about the xorg mailing list