shithub: choc

Download patch

ref: f56a8ac302a9ef2f5ff668d13f20cb4bb787fab0
parent: 930eae1c242daabda3668532e0638f5d19c65ed8
author: Simon Howard <fraggle@gmail.com>
date: Sat May 3 19:18:21 EDT 2014

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.

--- a/src/setup/joystick.c
+++ b/src/setup/joystick.c
@@ -239,6 +239,7 @@
 
     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 @@
         }
 
         // 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);