Commit Graph

9 Commits

Author SHA1 Message Date
Bill Currie b2e92c2864 Rewrite joy_axis and JOY_Move for axis buttons.
First, this completely smashes joystick input: it will not work (though it
doesn't crash). This is because there is, as of yet, no means to configure
the system.

Each joystick axis has:
    - per-axis amplification (both pre and post).
    - per-axis offset (offset applied after pre-amp but before post amp)
    - selectable destination:
        - linear delta: position and angles (as before)
        - axis button: if the value crosses the threshold, the given key is
          pressed or released as appropriate.

The axis amplification still uses joy_amp and joy_pre_amp (and
in_amp/in_pre_amp), but now also has the per-axis settings.

The per-axis offset is most useful for axis buttons. For example, the xbox
360 controller triggers are analong but go "all the way to negative on 0
state". Offsetting the input keeps axis button thresholds simple.

Amplification and offset is applied before anything is done with the axis
value. The formula is:

    joy_amp * in_amp * axis-amp *
        (offset + value * joy_pre_amp * in_pre_amp * axis-pre_amp)

Axis button thresholds are very simple: if the sign of the value is the
same as the sign of the threshold and abs(value) >= abs(threshold), the
button is pressed. While multiple thresholds and keys can be placed on an
axis, only one can be pressed at a time. The threshold furthest from 0
wins.
2013-01-23 13:15:02 +09:00
Bill Currie bc1b483525 Nuke the rcsid stuff.
It's pretty useless in git.
2012-04-22 10:56:32 +09:00
Jeff Teunissen bbc8154ec7 joystick fixes
Make /dev/input/js0 the default joy_device, and temporarily bump max
buttons to 18 (until I kill the maximums entirely)
2010-12-24 05:03:32 -05:00
Ragnvald Maartmann-Moe IV 2cb4c7836d Remove dead cvar. 2003-02-14 02:21:31 +00:00
Ragnvald Maartmann-Moe IV 94b1683862 Rest of previous commit. 2001-12-28 18:19:23 +00:00
Jeff Teunissen 5a7b7571f3 Misc. API header cleanups. 2001-05-19 23:24:20 +00:00
Bill Currie b025bb32e1 first steps 2001-04-11 19:56:01 +00:00
Ragnvald Maartmann-Moe IV f789b61c56 Merged joystick code. Great deal of cleanup in input, reduced bizarre overuse of protocol.h...
Maimed joy_win.c, very likely to get odd behavior there, even if it compiles.
2001-04-11 07:57:08 +00:00
Bill Currie 8e2d89c4c2 fix up a mis-understanding about api headers
*taniwha larts himself for not explaining things to Despair
2001-04-10 21:45:42 +00:00
Renamed from include/joystick.h (Browse further)