diff options
author | Simon Howard | 2014-04-30 22:56:04 -0400 |
---|---|---|
committer | Simon Howard | 2014-04-30 22:56:04 -0400 |
commit | 4890591ba50bfc8b11cda684b223cb7c551e6dd3 (patch) | |
tree | 589edddb7f25d68f2f7f9b990b82078eca728491 /src/m_config.c | |
parent | 96ff3f7bc127889c9f47e4ec17faa445ade623f1 (diff) | |
download | chocolate-doom-4890591ba50bfc8b11cda684b223cb7c551e6dd3.tar.gz chocolate-doom-4890591ba50bfc8b11cda684b223cb7c551e6dd3.tar.bz2 chocolate-doom-4890591ba50bfc8b11cda684b223cb7c551e6dd3.zip |
joystick: Add virtual-physical button mapping.
The solution to solving #386 is to add a layer of indirection: the
game code can only support up to ~20 joystick buttons, but this
doesn't matter as long as we never want to bind more than 20 buttons
to actions anyway. Redefine the game's notion of buttons to be based
on "virtual" joystick buttons, and map these buttons to physical
(SDL) buttons based on configuration file variables.
Diffstat (limited to 'src/m_config.c')
-rw-r--r-- | src/m_config.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/m_config.c b/src/m_config.c index 898c9368..90d3776f 100644 --- a/src/m_config.c +++ b/src/m_config.c @@ -939,6 +939,66 @@ static default_t extra_defaults_list[] = CONFIG_VARIABLE_INT(joystick_strafe_invert), //! + // The physical joystick button that corresponds to button #0. + // + + CONFIG_VARIABLE_INT(joystick_physical_button0), + + //! + // The physical joystick button that corresponds to button #1. + // + + CONFIG_VARIABLE_INT(joystick_physical_button1), + + //! + // The physical joystick button that corresponds to button #2. + // + + CONFIG_VARIABLE_INT(joystick_physical_button2), + + //! + // The physical joystick button that corresponds to button #3. + // + + CONFIG_VARIABLE_INT(joystick_physical_button3), + + //! + // The physical joystick button that corresponds to button #4. + // + + CONFIG_VARIABLE_INT(joystick_physical_button4), + + //! + // The physical joystick button that corresponds to button #5. + // + + CONFIG_VARIABLE_INT(joystick_physical_button5), + + //! + // The physical joystick button that corresponds to button #6. + // + + CONFIG_VARIABLE_INT(joystick_physical_button6), + + //! + // The physical joystick button that corresponds to button #7. + // + + CONFIG_VARIABLE_INT(joystick_physical_button7), + + //! + // The physical joystick button that corresponds to button #8. + // + + CONFIG_VARIABLE_INT(joystick_physical_button8), + + //! + // The physical joystick button that corresponds to button #9. + // + + CONFIG_VARIABLE_INT(joystick_physical_button9), + + //! // Joystick button to strafe left. // |