mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Compare commits
6 Commits
xf86-input
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1ee12b9a3 | ||
|
|
74690817fc | ||
|
|
b2cbbb178e | ||
|
|
7d91fc7bfc | ||
|
|
09987eab9a | ||
|
|
8af0e6f1eb |
@@ -23,7 +23,7 @@
|
||||
# Initialize Autoconf
|
||||
AC_PREREQ([2.60])
|
||||
AC_INIT([xf86-input-evdev],
|
||||
[2.7.1],
|
||||
[2.7.2],
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||
[xf86-input-evdev])
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
|
||||
@@ -51,7 +51,6 @@ static Atom prop_wheel_timeout = 0;
|
||||
static Atom prop_wheel_button = 0;
|
||||
|
||||
/* Local Funciton Prototypes */
|
||||
static BOOL EvdevWheelEmuHandleButtonMap(InputInfoPtr pInfo, WheelAxisPtr pAxis, char *axis_name);
|
||||
static int EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value);
|
||||
|
||||
/* Filter mouse button events */
|
||||
@@ -197,7 +196,8 @@ EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value)
|
||||
/* Handle button mapping here to avoid code duplication,
|
||||
returns true if a button mapping was found. */
|
||||
static BOOL
|
||||
EvdevWheelEmuHandleButtonMap(InputInfoPtr pInfo, WheelAxisPtr pAxis, char* axis_name)
|
||||
EvdevWheelEmuHandleButtonMap(InputInfoPtr pInfo, WheelAxisPtr pAxis,
|
||||
const char *axis_name)
|
||||
{
|
||||
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
||||
char *option_string;
|
||||
|
||||
32
src/evdev.c
32
src/evdev.c
@@ -93,7 +93,7 @@
|
||||
#define ABS_MT_TRACKING_ID 0x39
|
||||
#endif
|
||||
|
||||
static char *evdevDefaults[] = {
|
||||
static const char *evdevDefaults[] = {
|
||||
"XkbRules", "evdev",
|
||||
"XkbModel", "evdev",
|
||||
"XkbLayout", "us",
|
||||
@@ -278,7 +278,7 @@ EvdevRemoveDevice(InputInfoPtr pInfo)
|
||||
|
||||
|
||||
static void
|
||||
SetXkbOption(InputInfoPtr pInfo, char *name, char **option)
|
||||
SetXkbOption(InputInfoPtr pInfo, const char *name, char **option)
|
||||
{
|
||||
char *s;
|
||||
|
||||
@@ -1062,7 +1062,9 @@ EvdevProcessEvent(InputInfoPtr pInfo, struct input_event *ev)
|
||||
static void
|
||||
EvdevFreeMasks(EvdevPtr pEvdev)
|
||||
{
|
||||
#ifdef MULTITOUCH
|
||||
int i;
|
||||
#endif
|
||||
|
||||
valuator_mask_free(&pEvdev->vals);
|
||||
valuator_mask_free(&pEvdev->old_vals);
|
||||
@@ -1345,7 +1347,9 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device)
|
||||
|
||||
i = 0;
|
||||
for (axis = ABS_X; i < MAX_VALUATORS && axis <= ABS_MAX; axis++) {
|
||||
#ifdef MULTITOUCH
|
||||
int j;
|
||||
#endif
|
||||
int mapping;
|
||||
pEvdev->axis_map[axis] = -1;
|
||||
if (!EvdevBitIsSet(pEvdev->abs_bitmask, axis) ||
|
||||
@@ -1660,7 +1664,7 @@ EvdevInitButtonMapping(InputInfoPtr pInfo)
|
||||
/* Check for user-defined button mapping */
|
||||
if ((mapping = xf86CheckStrOption(pInfo->options, "ButtonMapping", NULL)))
|
||||
{
|
||||
char *map, *s = " ";
|
||||
char *map, *s = NULL;
|
||||
int btn = 0;
|
||||
|
||||
xf86IDrvMsg(pInfo, X_CONFIG, "ButtonMapping '%s'\n", mapping);
|
||||
@@ -2350,14 +2354,16 @@ EvdevOpenDevice(InputInfoPtr pInfo)
|
||||
}
|
||||
|
||||
#ifdef MULTITOUCH
|
||||
pEvdev->mtdev = mtdev_new_open(pInfo->fd);
|
||||
if (!pEvdev->mtdev) { /* after PreInit mtdev is still valid */
|
||||
pEvdev->mtdev = mtdev_new_open(pInfo->fd);
|
||||
if (!pEvdev->mtdev) {
|
||||
xf86Msg(X_ERROR, "%s: Couldn't open mtdev device\n", pInfo->name);
|
||||
EvdevCloseDevice(pInfo);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (pEvdev->mtdev)
|
||||
pEvdev->cur_slot = pEvdev->mtdev->caps.slot.value;
|
||||
else {
|
||||
xf86Msg(X_ERROR, "%s: Couldn't open mtdev device\n", pInfo->name);
|
||||
EvdevCloseDevice(pInfo);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Check major/minor of device node to avoid adding duplicate devices. */
|
||||
@@ -2562,7 +2568,7 @@ EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code)
|
||||
/* Aligned with linux/input.h.
|
||||
Note that there are holes in the ABS_ range, these are simply replaced with
|
||||
MISC here */
|
||||
static char* abs_labels[] = {
|
||||
static const char *abs_labels[] = {
|
||||
AXIS_LABEL_PROP_ABS_X, /* 0x00 */
|
||||
AXIS_LABEL_PROP_ABS_Y, /* 0x01 */
|
||||
AXIS_LABEL_PROP_ABS_Z, /* 0x02 */
|
||||
@@ -2625,7 +2631,7 @@ static char* abs_labels[] = {
|
||||
AXIS_LABEL_PROP_ABS_MT_PRESSURE, /* 0x3a */
|
||||
};
|
||||
|
||||
static char* rel_labels[] = {
|
||||
static const char *rel_labels[] = {
|
||||
AXIS_LABEL_PROP_REL_X,
|
||||
AXIS_LABEL_PROP_REL_Y,
|
||||
AXIS_LABEL_PROP_REL_Z,
|
||||
@@ -2638,7 +2644,7 @@ static char* rel_labels[] = {
|
||||
AXIS_LABEL_PROP_REL_MISC
|
||||
};
|
||||
|
||||
static char* btn_labels[][16] = {
|
||||
static const char *btn_labels[][16] = {
|
||||
{ /* BTN_MISC group offset 0x100*/
|
||||
BTN_LABEL_PROP_BTN_0, /* 0x00 */
|
||||
BTN_LABEL_PROP_BTN_1, /* 0x01 */
|
||||
@@ -2723,7 +2729,7 @@ static void EvdevInitAxesLabels(EvdevPtr pEvdev, int mode, int natoms, Atom *ato
|
||||
{
|
||||
Atom atom;
|
||||
int axis;
|
||||
char **labels;
|
||||
const char **labels;
|
||||
int labels_len = 0;
|
||||
|
||||
if (mode == Absolute)
|
||||
|
||||
Reference in New Issue
Block a user