summaryrefslogtreecommitdiff
path: root/src/void.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/void.c')
-rw-r--r--src/void.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/void.c b/src/void.c
index ce005d0..9d49308 100644
--- a/src/void.c
+++ b/src/void.c
@@ -52,6 +52,11 @@
#include <xf86Module.h>
#endif
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+#include <X11/Xatom.h>
+#include <xserver-properties.h>
+#endif
+
#define MAXBUTTONS 3
/******************************************************************************
@@ -178,7 +183,18 @@ xf86VoidControlProc(DeviceIntPtr device, int what)
XkbRMLVOSet rmlvo;
#endif
Bool result;
-
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ Atom btn_labels[MAXBUTTONS] = {0};
+ Atom axes_labels[2] = {0};
+
+ axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
+ axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
+
+ btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
+ btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
+ btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
+#endif
+
pInfo = device->public.devicePrivate;
switch (what)
@@ -192,6 +208,9 @@ xf86VoidControlProc(DeviceIntPtr device, int what)
if (InitButtonClassDeviceStruct(device,
MAXBUTTONS,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ btn_labels,
+#endif
map) == FALSE) {
ErrorF("unable to allocate Button class device\n");
return !Success;
@@ -224,6 +243,9 @@ xf86VoidControlProc(DeviceIntPtr device, int what)
if (InitValuatorClassDeviceStruct(device,
2,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ axes_labels,
+#endif
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
xf86GetMotionEvents,
#endif
@@ -231,12 +253,18 @@ xf86VoidControlProc(DeviceIntPtr device, int what)
Absolute) == FALSE) {
InitValuatorAxisStruct(device,
0,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ axes_labels[0],
+#endif
0, /* min val */1, /* max val */
1, /* resolution */
0, /* min_res */
1); /* max_res */
InitValuatorAxisStruct(device,
1,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+ axes_labels[1],
+#endif
0, /* min val */1, /* max val */
1, /* resolution */
0, /* min_res */