From 44ee577ee561c4c27cf05c9c32e57b947972c982 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 15 Dec 2009 11:56:29 +1000 Subject: xsetwacom: button numbers are one-indexed, store button action accordingly. Signed-off-by: Peter Hutterer --- tools/xsetwacom.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c index ac2d9e0..cbc2ea2 100644 --- a/tools/xsetwacom.c +++ b/tools/xsetwacom.c @@ -1171,6 +1171,7 @@ static void special_map_buttons(Display *dpy, XDevice *dev, param_t* param, int return; btn_no = get_button_number_from_string(param->name); + btn_no--; /* property is zero-indexed, button numbers are 1-indexed */ XGetDeviceProperty(dpy, dev, btnact_prop, 0, 100, False, AnyPropertyType, &type, &format, &btnact_nitems, @@ -1185,7 +1186,7 @@ static void special_map_buttons(Display *dpy, XDevice *dev, param_t* param, int else { char buff[64]; - sprintf(buff, "Wacom button action %d", btn_no); + sprintf(buff, "Wacom button action %d", (btn_no + 1)); prop = XInternAtom(dpy, buff, False); btnact_data[btn_no] = prop; -- cgit v1.2.1