diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-16 16:38:11 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-18 14:41:47 +1000 |
commit | a30fef9956b296f59ea18a9ee38d0abafeb15a4e (patch) | |
tree | ea0fc578946cf668ef0f1f7b8196c915f0e93b19 /hw/vfb/InitInput.c | |
parent | 17f9723f488d0470e3879c6b0dfdba61544cdd7b (diff) |
input: Add labels to buttons and valuators - ABI_XINPUT_VERSION 7
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw/vfb/InitInput.c')
-rw-r--r-- | hw/vfb/InitInput.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c index 4c8c99653..7f2d56fa8 100644 --- a/hw/vfb/InitInput.c +++ b/hw/vfb/InitInput.c @@ -41,6 +41,8 @@ from The Open Group. #include "lk201kbd.h" #include "xkbsrv.h" #include <X11/keysym.h> +#include "xserver-properties.h" +#include "exevents.h" Bool LegalModifier(unsigned int key, DeviceIntPtr pDev) @@ -87,8 +89,13 @@ vfbKeybdProc(DeviceIntPtr pDevice, int onoff) static int vfbMouseProc(DeviceIntPtr pDevice, int onoff) { - BYTE map[4]; +#define NBUTTONS 3 +#define NAXES 2 + + BYTE map[NBUTTONS + 1]; DevicePtr pDev = (DevicePtr)pDevice; + Atom btn_labels[NBUTTONS] = {0}; + Atom axes_labels[NAXES] = {0}; switch (onoff) { @@ -96,8 +103,16 @@ vfbMouseProc(DeviceIntPtr pDevice, int onoff) map[1] = 1; map[2] = 2; map[3] = 3; - InitPointerDeviceStruct(pDev, map, 3, - (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), 2); + + 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); + + axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); + axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); + + InitPointerDeviceStruct(pDev, map, NBUTTONS, btn_labels, + (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), NAXES, axes_labels); break; case DEVICE_ON: @@ -112,6 +127,9 @@ vfbMouseProc(DeviceIntPtr pDevice, int onoff) break; } return Success; + +#undef NBUTTONS +#undef NAXES } void |