xsetwacom set <devicename> Button 1
should unsets the key action for button 1 (back to button mapping)

Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
 tools/xsetwacom.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
index 417e095..afaa449 100644
--- a/tools/xsetwacom.c
+++ b/tools/xsetwacom.c
@@ -1197,7 +1197,8 @@ static void special_map_property(Display *dpy, XDevice 
*dev, Atom btnact_prop, i
                        fprintf(stderr, "Cannot parse keyword '%s'\n", 
words[i]);
        }
 
-       if (unset_prop)
+       /* if we don't have any data, don't update the property */
+       if (unset_prop || nitems > 0)
                XChangeDeviceProperty(dpy, dev, prop, XA_INTEGER, 32,
                                        PropModeReplace,
                                        (unsigned char*)data, nitems);
@@ -1293,14 +1294,14 @@ static void map_button(Display *dpy, XDevice *dev, 
param_t* param, int argc, cha
        int button, /* button to be mapped */
            mapping;
 
-       if (argc <= 1 || (sscanf(argv[0], "%d", &button) != 1))
+       if (argc < 1 || (sscanf(argv[0], "%d", &button) != 1))
                return;
 
        TRACE("Mapping %s for device %ld.\n", param->name, dev->device_id);
 
 
        /* --set "device" Button1 3 */
-       if (sscanf(argv[1], "%d", &mapping) == 1)
+       if (argc > 1 && sscanf(argv[1], "%d", &mapping) == 1)
                map_button_simple(dpy, dev, param, button, mapping);
        else
                special_map_buttons(dpy, dev, param, button, argc - 1, 
&argv[1]);
-- 
1.7.4


------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to