JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
joysticks: configurable, working, buttons enable joystick
authorJason Woofenden <jason@jasonwoof.com>
Thu, 5 May 2011 05:32:11 +0000 (01:32 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Thu, 5 May 2011 05:32:16 +0000 (01:32 -0400)
commitd59f1536f8e7bc05acafc11944907de73f591996
tree607a8d3d1b2c33029ba3a1040bd97f15acbc86c8
parent419f73382e82b9cb6602227a53c3350764f04040
joysticks: configurable, working, buttons enable

It works!

Press a joystick button to enable that joystick.

Here's why you need to enable the joystick: We don't want your ship to drift
when you have a joystick plugged in and you're not using it, and it doesn't
center perfectly.

You can use the -j/--joystick option to specify which axes you'd like to use
(I've tested it with a PlayStation 3 controller, I can use the tilt sensor to
control VoR like this:

vor -j 4,5

For those with axes but not any buttons (perhaps a handheld computer with an
accelerometer) you can enable a joystick with by adding the joystick number (0
unless you have multiple joysticks) as the third parameter to the -j/--joystick
flag, like this:

vor --joystick=0,1,0

The argument parser is passed the following argv value unless there's a =. When
parsing for your argument, you should barf if you get an invalid value that
looks like it might be a flag (and tell the user they forgot to put in your
argument.) The current parser will handle these forms:

vor -j 0,1
vor --joystick=0,1
vor --joystick 0,1

Still need to make sensitivity adjustable and enable reversing axes.
args.c
args.h
main.c