| Re: [AD] Linux joystick driver | 
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
George Foot <george.foot@xxxxxxxxxx> wrote:
>                                I don't know much about how
> joysticks work in Linux -- if you know how to fix this, then go
> right ahead. :)
I think I do. :) The source was smaller than the diff, so I attached
that.
I don't think there is a way to tell if a specific axis number is a
throttle, or is part of a stick (Allegro terminology), so I have added
Yet Another Config Variable, called `throttle_axis_X', where X is the
/dev/jsX number, or the fallback `throttle_axis'.  If unspecified the
driver will follow the current behavior and assume the last axis is
the 1d throttle.  Everything else will be grouped into 2-axis sticks.
The setup program should probably have a dialog to configure this, or
readme.lnx should have a note about this (I don't particularly feel
like writing either :)
Untested / un-done:
  * Multiple joysticks on multiple game ports.  I assume they
    are mapped to sequential /dev/jsX entries.
  * Two controllers on a Y-cable.  I don't know if the kernel
    maps these to separate device files.  If not, funny things
    will happen.
  * Devices with multiple 1d sticks (any?)
  * 3-axes-on-a-stick devices.  Ha! :)
One other thing: there were (and still are) a couple of mallocs in the
code which never got free'd.  Is it being done somewhere else, or are
they just too small to worry about?
Well, that's enough 8 space indentation code for one day.  I think my
peripheral vision has improved...
Peter
-- 
tjaden@xxxxxxxxxx - http://www.alphalink.com.au/~tjaden/
"There are no passengers on spaceship Free Software - we are all the crew."
Attachment:
ljoy.c.gz
Description: Binary data
| Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |