From 74e1b8b7548e6d14eb9be748279e8100a766cf04 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 19 Apr 2014 01:12:13 -0400 Subject: joystick: Add an axis to allow strafing. Modern gamepads typically have 2-3 D-pads and joysticks. This means that it's desirable to be able to use one joystick for turning and another for strafing. Add another axis in addition to the current X and y axes that performs strafe movement. --- src/setup/joystick.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/setup/joystick.c') diff --git a/src/setup/joystick.c b/src/setup/joystick.c index 064ff99d..9e04ba0b 100644 --- a/src/setup/joystick.c +++ b/src/setup/joystick.c @@ -63,6 +63,11 @@ static int joystick_x_invert = 0; static int joystick_y_axis = 1; static int joystick_y_invert = 0; +// Strafe axis. + +static int joystick_strafe_axis = -1; +static int joystick_strafe_invert = 0; + static txt_button_t *joystick_button; static int *all_joystick_buttons[] = { @@ -438,7 +443,9 @@ void BindJoystickVariables(void) M_BindVariable("joystick_index", &joystick_index); M_BindVariable("joystick_x_axis", &joystick_x_axis); M_BindVariable("joystick_y_axis", &joystick_y_axis); + M_BindVariable("joystick_strafe_axis", &joystick_strafe_axis); M_BindVariable("joystick_x_invert", &joystick_x_invert); M_BindVariable("joystick_y_invert", &joystick_y_invert); + M_BindVariable("joystick_strafe_invert",&joystick_strafe_invert); } -- cgit v1.2.3