On Thu, Jan 11, 2007 at 01:10:21PM -0700, Vitaliy Margolen wrote:
What you described is SetProperty(DIPROP_RANGE). What I'm talking about is the range we get from device itself. In the map_axis we have:
if (val > hmax) This->joydev->havemax[axis] = hmax = val; if (val < hmin) This->joydev->havemin[axis] = hmin = val;
to my knowledge this code is useless. it got copied over from the /dev/js branch.
We either need to query the device for what it's ranges are, or use default range (as it's done in joystick_linux).
we allready query it. see the code in alloc_device where the have(min|max) is set.
Right. But can we query device for the current axes position? They are analog devices, and should provide absolute position.
well instead of using ...[AXE_ABS] (another axe) we could use the current value from the device. what it is worth for is this:
i bet nearly all apps just call alloc_device and SetProperty in the beginning or when some config is involved. so AXE_ABS is for sure between MIN/MAX (kernel should assert that) and in nearly all cases represent the "null"-state of the device. so if someone fiddles with this input device between find_joydevs and alloc/setprop the value in DJOYSTATE2 would be wrong.
IMHO its not worth the hastle there.