diff options
author | Simon Howard | 2014-05-05 22:16:55 -0400 |
---|---|---|
committer | Simon Howard | 2014-05-05 22:16:55 -0400 |
commit | f102dc1c7d5e83c59b87afaf16c16a64c89db0c5 (patch) | |
tree | ad65f941d7f9c6d724c587e27edae54d8d93563d | |
parent | 7684ddcfd8c2c5fe069425ed420ed73342f2d9e5 (diff) | |
download | chocolate-doom-f102dc1c7d5e83c59b87afaf16c16a64c89db0c5.tar.gz chocolate-doom-f102dc1c7d5e83c59b87afaf16c16a64c89db0c5.tar.bz2 chocolate-doom-f102dc1c7d5e83c59b87afaf16c16a64c89db0c5.zip |
setup: Add Xbox360, Logitech joystick settings.
Recognise the Xbox360 controller and Logitech Dual Action controllers
and set defaults as appropriate. Thanks to Brad Harding for the
information about these controllers.
-rw-r--r-- | src/setup/joystick.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/setup/joystick.c b/src/setup/joystick.c index 16e841bf..1b2a00f3 100644 --- a/src/setup/joystick.c +++ b/src/setup/joystick.c @@ -209,6 +209,39 @@ static const joystick_config_t wii_controller_wjoy[] = {NULL, 0}, }; +// Xbox 360 controller. Thanks to Brad Harding for the details. +static const joystick_config_t xbox360_controller[] = +{ + {"joystick_x_axis", CREATE_HAT_AXIS(0, HAT_AXIS_HORIZONTAL)}, + {"joystick_y_axis", CREATE_HAT_AXIS(0, HAT_AXIS_VERTICAL)}, + {"joystick_strafe_axis", 2}, // Trigger buttons form an axis(???) + {"joyb_fire", 2}, // X + {"joyb_speed", 0}, // A + {"joyb_jump", 3}, // Y + {"joyb_use", 1}, // B + {"joyb_prevweapon", 4}, // LB + {"joyb_nextweapon", 5}, // RB + {"joyb_menu_activate", 9}, // Start + {NULL, 0}, +}; + +// Logitech Dual Action (F310, F710). Thanks to Brad Harding for details. +static const joystick_config_t logitech_f310_controller[] = +{ + {"joystick_x_axis", CREATE_HAT_AXIS(0, HAT_AXIS_HORIZONTAL)}, + {"joystick_y_axis", CREATE_HAT_AXIS(0, HAT_AXIS_VERTICAL)}, + {"joyb_fire", 0}, // X + {"joyb_speed", 1}, // A + {"joyb_jump", 3}, // Y + {"joyb_use", 2}, // B + {"joyb_strafeleft", 6}, // LT + {"joyb_straferight", 7}, // RT + {"joyb_prevweapon", 4}, // LB + {"joyb_nextweapon", 5}, // RB + {"joyb_menu_activate", 11}, // Start + {NULL, 0}, +}; + static const known_joystick_t known_joysticks[] = { { @@ -228,6 +261,18 @@ static const known_joystick_t known_joysticks[] = 6, 26, 0, wii_controller_wjoy, }, + + { + "Controller (XBOX 360 For Windows)", + 5, 10, 1, + xbox360_controller, + }, + + { + "Logitech Dual Action", + 4, 12, 1, + logitech_f310_controller, + }, }; static const known_joystick_t *GetJoystickType(int index) |