foxygit / doom Log in
commit f56a8ac302a9ef2f5ff668d13f20cb4bb787fab0
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sat May 3 23:18:21 2014 -0400
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sat May 3 23:18:21 2014 -0400

    setup: Fix disabling of joystick button bindings.

    When setting a joystick button binding to -1 to disable it, set it
    directly; do not go through to the physical button mapping layer.

    Also add a quick note to encourage users to send in details of their
    gamepads.
---
 src/setup/joystick.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/setup/joystick.c b/src/setup/joystick.c
index f0c65780..725cc287 100644
--- a/src/setup/joystick.c
+++ b/src/setup/joystick.c
@@ -239,6 +239,7 @@ static const known_joystick_t *GetJoystickType(int index)

     printf("Unknown joystick '%s' with %i axes, %i buttons, %i hats\n",
            name, axes, buttons, hats);
+    printf("Please consider sending in details about your gamepad!\n");

     return NULL;
 }
@@ -270,7 +271,7 @@ static void LoadConfigurationSet(const joystick_config_t *configs)
         }

         // For buttons, set the virtual button mapping as well.
-        if (M_StringStartsWith(config->name, "joyb_"))
+        if (M_StringStartsWith(config->name, "joyb_") && config->value >= 0)
         {
             joystick_physical_buttons[button] = config->value;
             M_snprintf(buf, sizeof(buf), "%i", button);