[dinput][joystick_linuxinput] make axes work, that are "not in a row"

Christoph Frick frick at sc-networks.de
Fri Jan 12 03:56:42 CST 2007


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.

-- 
cu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20070112/53bccf39/attachment.pgp


More information about the wine-devel mailing list