[arch-commits] CVS update of extra/x11-drivers/xf86-input-evdev (2 files)
Jan de Groot
jgc at archlinux.org
Sun Mar 16 22:50:28 UTC 2008
Date: Sunday, March 16, 2008 @ 18:50:28
Author: jgc
Path: /home/cvs-extra/extra/x11-drivers/xf86-input-evdev
Added: evdev-1.2-git20080303.patch (1.1)
Modified: PKGBUILD (1.9 -> 1.10)
upgpkg: xf86-input-evdev 1.2.0-2
Add fixes from git
-----------------------------+
PKGBUILD | 16 -
evdev-1.2-git20080303.patch | 506 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 515 insertions(+), 7 deletions(-)
Index: extra/x11-drivers/xf86-input-evdev/PKGBUILD
diff -u extra/x11-drivers/xf86-input-evdev/PKGBUILD:1.9 extra/x11-drivers/xf86-input-evdev/PKGBUILD:1.10
--- extra/x11-drivers/xf86-input-evdev/PKGBUILD:1.9 Fri Nov 16 07:49:45 2007
+++ extra/x11-drivers/xf86-input-evdev/PKGBUILD Sun Mar 16 18:50:28 2008
@@ -1,23 +1,25 @@
-# $Id: PKGBUILD,v 1.9 2007/11/16 12:49:45 alexander Exp $
+# $Id: PKGBUILD,v 1.10 2008/03/16 22:50:28 jgc Exp $
# Maintainer: Alexander Baldeck <Alexander at archlinux.org
# Contributor: Jan de Groot <jgc at archlinux.org>
pkgname=xf86-input-evdev
pkgver=1.2.0
-pkgrel=1
+pkgrel=2
pkgdesc="X.org evdev input driver"
arch=(i686 x86_64)
url="http://xorg.freedesktop.org/"
-depends=('glibc')
-makedepends=('pkgconfig' 'xorg-server>=1.4')
+depends=('glibc>=2.7')
+makedepends=('pkgconfig' 'xorg-server>=1.4.0.90')
options=('!libtool')
groups=('xorg-input-drivers')
-source=(${url}/releases/individual/driver/${pkgname}-${pkgver}.tar.bz2)
+source=(${url}/releases/individual/driver/${pkgname}-${pkgver}.tar.bz2
+ evdev-1.2-git20080303.patch)
+md5sums=('0c7c41d3f1637bb559e80c2ad708f05d'
+ '00608837818ee311376e659992c127c9')
build() {
cd ${startdir}/src/${pkgname}-${pkgver}
+ patch -Np1 -i ${startdir}/src/evdev-1.2-git20080303.patch || return 1
./configure --prefix=/usr
make || return 1
make DESTDIR=${startdir}/pkg install || return 1
}
-
-md5sums=('0c7c41d3f1637bb559e80c2ad708f05d')
Index: extra/x11-drivers/xf86-input-evdev/evdev-1.2-git20080303.patch
diff -u /dev/null extra/x11-drivers/xf86-input-evdev/evdev-1.2-git20080303.patch:1.1
--- /dev/null Sun Mar 16 18:50:28 2008
+++ extra/x11-drivers/xf86-input-evdev/evdev-1.2-git20080303.patch Sun Mar 16 18:50:28 2008
@@ -0,0 +1,506 @@
+diff --git a/man/evdev.man b/man/evdev.man
+index 2a11945..72d780b 100644
+--- a/man/evdev.man
++++ b/man/evdev.man
+@@ -22,9 +22,7 @@ The
+ .B evdev
+ driver can serve as both a pointer and a keyboard input device, and may be
+ used as both the core keyboard and the core pointer. Multiple input devices
+-are supported by multiple instances of this driver, with one Load
+-directive for evdev in the Module section of your __xconfigfile__ for each
+-input device that will use this driver.
++are supported by multiple instances of this driver.
+ .PP
+ .SH SUPPORTED HARDWARE
+ In general, any input device that the kernel has a driver for can be accessed
+@@ -39,186 +37,35 @@ section only covers configuration details specific to this driver.
+ .PP
+ .SH BASIC CONFIGURATIONS
+ Most users of this driver will probably be quite happy with the following for
+-all QWERTY keyboards:
++all keyboards and mice:
+ .PP
+ .nf
+ .B "Section \*qInputDevice\*q"
+ .BI " Identifier \*q" keyboard \*q
+ .B " Driver \*qevdev\*q"
+-.BI " Option \*qevBits\*q \*q" "+1" \*q
+-.BI " Option \*qkeyBits\*q \*q" "~1\-255 ~352\-511" \*q
+-.BI " Option \*qPass\*q \*q" "3" \*q
++.BI " Option \*qDevice\*q \*q" "/dev/input/by-path/..." \*q
+ \ \ ...
+ .B EndSection
+ .fi
+ .PP
+-And the following for all mice:
+-.PP
+-.nf
+-.B "Section \*qInputDevice\*q"
+-.BI " Identifier \*q" mouse \*q
+-.B " Driver \*qevdev\*q"
+-.BI " Option \*qevBits\*q \*q" "+1\-2" \*q
+-.BI " Option \*qkeyBits\*q \*q" "~272\-287" \*q
+-.BI " Option \*qrelBits\*q \*q" "~0\-2 ~6 ~8" \*q
+-.BI " Option \*qPass\*q \*q" "3" \*q
+-\ \ ...
+-.B EndSection
+-.fi
+-.PP
+-To understand what those Bits options do, or for more complex
+-configurations, please see
+-.BR "ADVANCED OPTIONS"
+-below.
+-.PP
+ .SH ADVANCED OPTIONS
+ .SS DEVICE SPECIFICATION
+-For this section you'll want to have knowledge of
+-.B glob (7)
+-and our evil
+-.B "BIT MATCHING SPECIFICATION"
+-stuff.
+-.PP
+-The following driver
+-.B Options
+-control what devices are accepted:
+-
+ .TP 7
+-.BI "Option \*qDevice\*q \*q" string \*q
+-Specifies the device note through which the device can be accessed.
+-At this time ONLY
+-.RI /dev/input/event n ,
+-where
+-.I n
+-is an integer, are matched against this this field.
+-.fi
+-This option uses globbing.
+-.fi
+-Please note that use of this option is strongly discouraged.
+-
++.BI "Option \*qPath\*q \*q" string \*q
+ .TP 7
+-.BI "Option \*qName\*q \*q" string \*q
+-Specifies the device name for the device you wish to use.
+-.fi
+-The device name is generally the only consistent identifier for devices
+-that are commonly unplugged and plugged back into different ports.
+-.fi
+-A list of currently plugged in devices and associated device names can be
+-obtained by typing \*qcat /proc/bus/input/devices\*q, the \*qName\*q field
+-is the value you want for this option.
+-.fi
+-This option uses globbing.
+-
+-.TP 7
+-.BI "Option \*qPhys\*q \*q" string \*q
+-Specifies the device phys string for the device you wish to use.
+-.fi
+-The phys string is generally consistent to the USB port a device is plugged
+-into.
+-.fi
+-A list of currently plugged in devices and associated device names can be
+-obtained by typing \*qcat /proc/bus/input/devices\*q, the \*qPhys\*q field
+-is the value you want for this option.
+-.fi
+-This option uses globbing.
+-
+-.TP 7
+-.BI "Option \*q" map "Bits\*q \*q" "bit specifier" \*q
+-Specifies device capability bits which must be set, possibly set, or unset.
+-.fi
+-.IR map "Bits: Where " map
+-is one of
+-.BR ev ", " key ", " rel ", " abs ,
+-.BR msc ", " led ", " snd ", or " ff .
+-.fi
+-The bit specifier format is a string consisting of
+-.RI + n ", \-" n ", and ~" n
+-space-separated specifiers, where
+-.I n
+-is a positive integer or integer range. (The latter given in the format of 2\-6.)
+-.fi
+-+ specifies bits which must be set.
+-.fi
+-\- specifies bits which must not be set.
+-.fi
+-~ is a little more complex, it specifies that at least one of the bits given
+-with ~ for the field in question must be set, but it doesn't matter how many
+-or which of the bits. (It is actually the most useful of the 3 specifiers.)
+-.fi
+-As an example, \*q+0 +3 \-1\-2 ~5\-10\*q requires bits 0 and 3 be set,
+-bits 1 and 2 to not be set, and at least one bit in the range of 5 to
+-10 be set.
+-.fi
+-An annoyingly formatted set of bitmasks for your devices can be obtained
+-by typing \*qcat /proc/bus/input/devices\*q, and
+-.B /usr/include/linux/input.h
+-should contain the defines which declare what bits are what for each field.
+-
+-.TP 7
+-.BI "Option \*qbustype\*q \*q" n \*q
+-Specifies the bus ID for the device you wish to use.
+-.fi
+-This is either 0 (the default, matches anything), or the
+-.BI Bus= n
+-field in
+-.B /proc/bus/input/devices
+-for your device.
+-.fi
+-This value depends on what type of bus your device is connected to.
+-
+-.TP 7
+-.BI "Option \*qvendor\*q \*q" n \*q
+-Specifies the vendor ID for the device you wish to use.
+-.fi
+-This is either 0 (the default, matches anything), or the
+-.BI Vendor= n
+-field in
+-.B /proc/bus/input/devices
+-for your device.
+-.fi
+-This value should remain constant barring perhaps firmware updates to the
+-device itself.
+-
+-.TP 7
+-.BI "Option \*qversion\*q \*q" n \*q
+-Specifies the version for the device you wish to use.
+-.fi
+-This is either 0 (the default, matches anything), or the
+-.BI Version= n
+-field in
+-.B /proc/bus/input/devices
+-for your device.
+-.fi
+-This value should remain constant barring perhaps firmware updates to the
+-device itself.
+-
+-.TP 7
+-.BI "Option \*qproduct\*q \*q" n \*q
+-Specifies the product ID for the device you wish to use.
+-.fi
+-This is either 0 (the default, matches anything), or the
+-.BI Product= n
+-field in
+-.B /proc/bus/input/devices
+-for your device.
++.BI "Option \*qDevice\*q \*q" string \*q
++Specifies the device node through which the device can be accessed.
++You might want to use the more persistent symlinks provided in /dev/input/by-id
++or /dev/input/by-path.
+ .fi
+-This value should remain constant barring perhaps firmware updates to the
+-device itself.
+-
++This parameter is mandatory.
+ .TP 7
+-.BI "Option \*qPass\*q \*q" n \*q
+-Specifies the order in which evdev will scan for devices.
+-.fi
+-This is in the range of 0 to 3, and is used for the case
+-where more then one evdev input section matches the same device.
++.BI "Option \*qMode\*q \*q" mode \*q
++This selects the default mode for the device.
+ .fi
+-An input section with a lower pass number will always beat out
+-one with a higher pass number. Order when both sections are
+-the same number is undefined.
++Valid values are \*qabsolute\*q and \*qrelative\*q.
+ .fi
+-The default is 0.
+-
+-
++This can be set at run time per actual device with the xinput utility.
+ .PP
+ .SS RELATIVE AXIS CONFIGURATION
+ The relative axis portion of this driver handle all reported relative axes.
+@@ -238,20 +85,25 @@ The following driver
+ .B Options
+ control the relative axis portion of the driver:
+ .TP 7
+-.BI "Option \*q" axis "RelativeAxisMap\*q \*q" n \*q
+-This remaps the axis specified to the specified valuator.
+-.TP 7
+-.BI "Option \*q" axis "RelativeAxisButtons\*q \*q" "n n" \*q
+-This remaps the axis specified to the specified buttons.
+-.fi
+-Note that the physical buttons are always remapped around \*qfake\*q buttons
+-created by this option, so that if you have physical buttons 1 2 3 4 5,
+-and map the Wheel axis to buttons 4 5, you get buttons 1 2 3
+-.B 4 5
+-6 7, with buttons 6 and 7 being physical buttons 4 and 5.
++.BI "Option \*qRel" "%s" "MapTo\*q \*q" string \*q
++This remaps the axis specified by
++.I "%s"
++to
++.IR string .
++See Section
++.B "AXIS MAPPING"
++for valid values.
++.TP 7
++.BI "Option \*qRel" "%s" "Options\*q \*q" "string" \*q
++This sets some options for the relative axis specified by
++.IR %s .
++Valid value
++is \*qinvert\*q.
++.fi
++<documentation needed>
+ .PP
+ .SS ABSOLUTE AXIS CONFIGURATION
+-The relative axis portion of this driver handle all reported relative axes.
++The absolute axis portion of this driver handles all reported absolute axes.
+ .fi
+ The axes are named X, Y, Z, RX, RY, RZ, THROTTLE, RUDDER, WHEEL, GAS, BRAKE,
+ <11\-15>, HAT0X, HAT0Y, HAT1X, HAT1Y, HAT2X, HAT2Y, HAT3X, HAT3Y, PRESSURE,
+@@ -267,28 +119,55 @@ to x and y coordinates, respectively.
+ .fi
+ The following driver
+ .B Options
+-control the relative axis portion of the driver:
++control the absolute axis portion of the driver:
+ .TP 7
+-.BI "Option \*q" axis "AbsoluteAxisMap\*q \*q" n \*q
+-This remaps the axis specified to the specified valuator.
++.BI "Option \*qAbs" "%s" "MapTo\*q \*q" string \*q
++This remaps the axis specified by
++.I "%s"
++to
++.IR string .
++See Section
++.B "AXIS MAPPING"
++for valid values.
+ .TP 7
+-.BI "Option \*qAbsoluteScreen\*q \*q" n \*q
+-This binds the device to a specific screen, scaling it to
+-the coordinate space of that screen.
+-.fi
+-The number can either be \-1, or a valid screen number.
++.BI "Option \*qAbs" "%s" "Options\*q \*q" string \*q
++This sets some options for the absolute axis specified by
++.IR "%s" .
+ .fi
+-If \-1 or if in relative mode no scaling or screen fixing is done.
++Valid values are \*qinvert\*q, \*quse_touch\*q, \*qmode_auto\*q,
++\*qmode_rel\*q.
+ .fi
+-This is of most use for digitizers, where the screen and the input
+-device are the same surface.
++<documentation needed>
+ .TP 7
+-.BI "Option \*qMode\*q \*q" mode \*q
+-This selects the default mode for the device.
++.BI "Option \*qAbsoluteTouch\*q \*q" string \*q
++<documentation needed>
+ .fi
+-Valid values are \*qabsolute\*q and \*qrelative\*q.
+-.fi
+-This can be set at run time per actual device with the xinput utility.
++Default: DIGI_Touch
++.PP
++.SS AXIS MAPPING
++The following axis mappings are recognized:
++.TP 7
++.BI "\*qRelAxis " <axis> \*q
++Map the axis to the specified
++.I <axis>
++in relative mode. This can be either a number or a name.
++.TP 7
++.BI "\*qAbsAxis " "<axis> <min> <max>" \*q
++Maps the axis to the specified
++.I <axis>
++in absolute mode. This can be either a number or a name.
++.TP 7
++.BI "\*qButton " "<button>" \*q
++Maps the button to the button specified with
++.IR <button> .
++This can be either a button number or a name.
++.TP 7
++.BI "\*qButtons " "<button+> <button->" \*q
++Maps the positive axis to the button specified with
++.I <button+>
++and the negative axis to the button specified with
++.IR <button-> .
++These can be either button numbers or names.
+ .PP
+ .SS BUTTON CONFIGURATION
+ At the moment, the button portion of this driver only handles buttons
+diff --git a/src/evdev.c b/src/evdev.c
+index dc801d0..38f80ef 100644
+--- a/src/evdev.c
++++ b/src/evdev.c
+@@ -401,13 +401,21 @@ EvdevPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
+ pEvdev->device = xf86CheckStrOption(dev->commonOptions, "path", NULL);
+ if (!pEvdev->device)
+ pEvdev->device = xf86CheckStrOption(dev->commonOptions, "Device", NULL);
++ if (!pEvdev->device) {
++ xf86Msg(X_ERROR, "%s: No Device specified.\n", pInfo->name);
++ pInfo->private = NULL;
++ xfree(pEvdev);
++ xf86DeleteInput (pInfo, 0);
++ return NULL;
++ }
+
+ xf86CollectInputOptions(pInfo, NULL, NULL);
+ xf86ProcessCommonOptions(pInfo, pInfo->options);
+
+ SYSCALL(pInfo->fd = open (pEvdev->device, O_RDWR | O_NONBLOCK));
+ if (pInfo->fd == -1) {
+- xf86Msg(X_ERROR, "%s: cannot open input pEvdev\n", pInfo->name);
++ xf86Msg(X_ERROR, "%s: cannot open device '%s': %s\n",
++ pInfo->name, pEvdev->device, strerror(errno));
+ pInfo->private = NULL;
+ xfree(pEvdev);
+ xf86DeleteInput (pInfo, 0);
+diff --git a/src/evdev.h b/src/evdev.h
+index 9d84843..2cdc5bc 100644
+--- a/src/evdev.h
++++ b/src/evdev.h
+@@ -110,7 +110,7 @@ typedef struct {
+ int real_buttons;
+ int buttons;
+ int b_flags[BTN_MAX];
+- void *b_map_data[ABS_MAX];
++ void *b_map_data[BTN_MAX];
+ evdev_map_func_f b_map[BTN_MAX];
+ void (*callback[BTN_MAX])(InputInfoPtr pInfo, int button, int value);
+ } evdevBtnRec, *evdevBtnPtr;
+diff --git a/src/evdev_axes.c b/src/evdev_axes.c
+index e967c61..5d196ab 100644
+--- a/src/evdev_axes.c
++++ b/src/evdev_axes.c
+@@ -709,6 +709,7 @@ EvdevAxisAbsNew1(InputInfoPtr pInfo)
+
+ {
+ int btn;
++ int i;
+
+ s = xf86SetStrOption(pInfo->options, "AbsoluteTouch", "DIGI_Touch");
+ btn = EvdevBtnFind (pInfo, s);
+@@ -719,6 +720,18 @@ EvdevAxisAbsNew1(InputInfoPtr pInfo)
+ xf86Msg(X_ERROR, "%s: state->btn: %p.\n", pInfo->name, state->btn);
+ state->btn->callback[btn] = &EvdevAxesTouchCallback;
+ } else {
++
++ /*
++ * If the device does not have a touch button, then clear
++ * EV_ABS_V_USE_TOUCH which we may have set for the X and Y
++ * axes in EvdevAxisAbsNew.
++ */
++ for (i = 0; i < ABS_MAX; i++) {
++ if ((i == ABS_X || i == ABS_Y) &&
++ state->abs->v_flags[i] & EV_ABS_V_PRESENT) {
++ state->abs->v_flags[i] &= ~EV_ABS_V_USE_TOUCH;
++ }
++ }
+ xf86Msg(X_ERROR, "%s: AbsoluteTouch: '%s' does not exist.\n", pInfo->name, s);
+ }
+ } else {
+diff --git a/src/evdev_btn.c b/src/evdev_btn.c
+index c03f879..340be82 100644
+--- a/src/evdev_btn.c
++++ b/src/evdev_btn.c
+@@ -322,18 +322,6 @@ EvdevBtnInit (DeviceIntRec *device)
+ int
+ EvdevBtnOn (DeviceIntRec *device)
+ {
+- InputInfoRec *pInfo = device->public.devicePrivate;
+- evdevDeviceRec *pEvdev = pInfo->private;
+- int i, blocked;
+-
+- if (!pEvdev->state.btn)
+- return Success;
+-
+- blocked = xf86BlockSIGIO ();
+- for (i = 1; i <= pEvdev->state.btn->buttons; i++)
+- xf86PostButtonEvent (device, 0, i, 0, 0, 0);
+- xf86UnblockSIGIO (blocked);
+-
+ return Success;
+ }
+
+diff --git a/src/evdev_key.c b/src/evdev_key.c
+index eed6319..dcbe48e 100644
+--- a/src/evdev_key.c
++++ b/src/evdev_key.c
+@@ -75,6 +75,10 @@
+ #define MODEFLAG 8
+ #define COMPOSEFLAG 16
+
++/* Exported by xorg-server, xkb/xkbAccessX.c */
++extern int XkbDfltRepeatDelay;
++extern int XkbDfltRepeatInterval;
++
+ /* FIXME: this map works with evdev keyboards, but all the xkb maps
+ * probably don't. The easiest is to remap the event keycodes. */
+
+@@ -353,21 +357,6 @@ EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl)
+ ev[i].value = (ctrl->leds & bits[i].xbit) > 0;
+ }
+ write(pInfo->fd, ev, sizeof(ev));
+-
+- if (device->key && device->key->xkbInfo && device->key->xkbInfo->desc
+- && device->key->xkbInfo->desc->ctrls) {
+- XkbControlsRec *ctrls = device->key->xkbInfo->desc->ctrls;
+-
+- ev[0].type = EV_REP;
+- ev[0].code = REP_DELAY;
+- ev[0].value = ctrls->repeat_delay;
+-
+- ev[1].type = EV_REP;
+- ev[1].code = REP_PERIOD;
+- ev[1].value = ctrls->repeat_interval;
+-
+- write(pInfo->fd, ev, sizeof(ev[0]) * 2);
+- }
+ }
+
+ int
+@@ -426,6 +415,18 @@ EvdevKeyInit (DeviceIntPtr device)
+ XkbInitKeyboardDeviceStruct (device, &state->key->xkbnames, &keySyms, modMap,
+ NULL, EvdevKbdCtrl);
+
++
++ if (device->key &&
++ device->key->xkbInfo &&
++ device->key->xkbInfo->desc &&
++ device->key->xkbInfo->desc->ctrls)
++ {
++ XkbControlsPtr ctrls = device->key->xkbInfo->desc->ctrls;
++ ctrls->repeat_delay = XkbDfltRepeatDelay;
++ ctrls->repeat_interval = XkbDfltRepeatInterval;
++ }
++
++
+ return Success;
+ }
+
+@@ -537,12 +538,29 @@ EvdevKeyProcess (InputInfoPtr pInfo, struct input_event *ev)
+ DeviceIntPtr device = pInfo->dev;
+ KeyClassRec *keyc = device->key;
+ KbdFeedbackClassRec *kbdfeed = device->kbdfeed;
++
++ /* See xkb/ddxCtrls.c: XkbDDXUsesSoftRepeat
++ Xorg-server will only generate soft autorepeats, when
++ inverval/delay are NOT set to the default values of 40/660.
++
++ We let the kernel autorepeat events pass, when we hit the
++ default value and the key is not a modifier. */
++ if (device->key &&
++ device->key->xkbInfo &&
++ device->key->xkbInfo->desc &&
++ device->key->xkbInfo->desc->ctrls)
++ {
++ if ((device->key->xkbInfo->desc->ctrls->repeat_interval != 40) ||
++ (device->key->xkbInfo->desc->ctrls->repeat_delay != 660))
++ return;
++ }
++
+ int num = keycode >> 3;
+ int bit = 1 << (keycode & 7);
+
+ if (keyc->modifierMap[keycode] ||
+- !(kbdfeed->ctrl.autoRepeats[num] & bit))
+- return;
++ !(kbdfeed->ctrl.autoRepeats[num] & bit))
++ return;
+ }
+
+ xf86PostKeyboardEvent(pInfo->dev, keycode, ev->value);
More information about the arch-commits
mailing list