Commit 742b87f7 authored by Povilas Kanapickas's avatar Povilas Kanapickas
Browse files

xfree86: Fix axis labels for PointerAbsolute input of inputtest driver


Signed-off-by: Povilas Kanapickas's avatarPovilas Kanapickas <povilas@radix.lt>
parent e4a9f0bb
......@@ -47,7 +47,7 @@
#include "xf86-input-inputtest-protocol.h"
#define POINTER_NUM_AXES 4 /* x, y, hscroll, vscroll */
#define MAX_POINTER_NUM_AXES 4 /* x, y, hscroll, vscroll */
#define TOUCH_NUM_AXES 4 /* x, y, hscroll, vscroll */
#define TOUCH_MAX_SLOTS 15
......@@ -303,16 +303,21 @@ init_pointer(InputInfoPtr pInfo)
DeviceIntPtr dev= pInfo->dev;
int min, max, res;
int nbuttons = 7;
int num_axes = 0;
unsigned char btnmap[MAX_BUTTONS + 1];
Atom btnlabels[MAX_BUTTONS];
Atom axislabels[POINTER_NUM_AXES];
Atom axislabels[MAX_POINTER_NUM_AXES];
nbuttons = xf86SetIntOption(pInfo->options, "PointerButtonCount", 7);
init_button_map(btnmap, ARRAY_SIZE(btnmap));
init_button_labels(btnlabels, ARRAY_SIZE(btnlabels));
init_axis_labels(axislabels, ARRAY_SIZE(axislabels));
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HSCROLL);
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_VSCROLL);
InitPointerDeviceStruct((DevicePtr)dev,
btnmap,
......@@ -320,7 +325,7 @@ init_pointer(InputInfoPtr pInfo)
btnlabels,
ptr_ctl,
GetMotionHistorySize(),
POINTER_NUM_AXES,
num_axes,
axislabels);
min = -1;
max = -1;
......@@ -341,16 +346,21 @@ init_pointer_absolute(InputInfoPtr pInfo)
DeviceIntPtr dev = pInfo->dev;
int min, max, res;
int nbuttons = 7;
int num_axes = 0;
unsigned char btnmap[MAX_BUTTONS + 1];
Atom btnlabels[MAX_BUTTONS];
Atom axislabels[POINTER_NUM_AXES];
Atom axislabels[MAX_POINTER_NUM_AXES];
nbuttons = xf86SetIntOption(pInfo->options, "PointerButtonCount", 7);
init_button_map(btnmap, ARRAY_SIZE(btnmap));
init_button_labels(btnlabels, ARRAY_SIZE(btnlabels));
init_axis_labels(axislabels, ARRAY_SIZE(axislabels));
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X);
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y);
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HSCROLL);
axislabels[num_axes++] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_VSCROLL);
InitPointerDeviceStruct((DevicePtr)dev,
btnmap,
......@@ -358,7 +368,7 @@ init_pointer_absolute(InputInfoPtr pInfo)
btnlabels,
ptr_ctl,
GetMotionHistorySize(),
POINTER_NUM_AXES,
num_axes ,
axislabels);
min = 0;
max = TOUCH_AXIS_MAX;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment