summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-12-15 11:56:29 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-12-15 11:56:52 +1000
commit44ee577ee561c4c27cf05c9c32e57b947972c982 (patch)
tree4447b3813fdab52bf754c39df300a78a41e17515 /tools
parent5e94aa26a263de8184695fb66a7e95e89a6df0bf (diff)
downloadxf86-input-wacom-44ee577ee561c4c27cf05c9c32e57b947972c982.tar.gz
xsetwacom: button numbers are one-indexed, store button action accordingly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/xsetwacom.c3
1 files changed, 2 insertions, 1 deletions
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;