Initialize Tizen 2.3 2.3a_release submit/tizen_2.3/20140531.114856
authorSehong Na <sehong.na@samsung.com>
Sat, 31 May 2014 04:20:52 +0000 (13:20 +0900)
committerSehong Na <sehong.na@samsung.com>
Sat, 31 May 2014 04:20:52 +0000 (13:20 +0900)
21 files changed:
COPYING [new file with mode: 0644]
ChangeLog [new file with mode: 0644]
INSTALL [new file with mode: 0644]
Makefile.am [new file with mode: 0644]
README [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
configure.ac [new file with mode: 0644]
include/Makefile.am [new file with mode: 0644]
include/evdev-properties.h [new file with mode: 0755]
man/Makefile.am [new file with mode: 0644]
man/evdev.man [new file with mode: 0644]
packaging/xorg-x11-drv-evdev.spec [new file with mode: 0644]
src/Makefile.am [new file with mode: 0644]
src/apple.c [new file with mode: 0644]
src/draglock.c [new file with mode: 0644]
src/emuMB.c [new file with mode: 0644]
src/emuThird.c [new file with mode: 0644]
src/emuWheel.c [new file with mode: 0644]
src/evdev.c [new file with mode: 0755]
src/evdev.h [new file with mode: 0755]
xorg-evdev.pc.in [new file with mode: 0644]

diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..68e43fe
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,69 @@
+Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+Copyright 1993 by David Dawes <dawes@xfree86.org>
+Copyright 2002 by SuSE Linux AG, Author: Egbert Eich
+Copyright 1994-2002 by The XFree86 Project, Inc.
+Copyright 2002 by Paul Elliott
+Copyright © 2008 University of South Australia
+Copyright 2008 by Chris Salch
+Copyright © 2008 Red Hat, Inc.
+
+Permission to use, copy, modify, distribute, and sell this software
+and its documentation for any purpose is hereby granted without
+fee, provided that the above copyright notice appear in all copies
+and that both that copyright notice and this permission notice
+appear in supporting documentation, and that the name of the authors
+not be used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.  The authors make no
+representations about the suitability of this software for any
+purpose.  It is provided "as is" without express or implied
+warranty.
+
+THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+Copyright 2005 Adam Jackson.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+on the rights to use, copy, modify, merge, publish, distribute, sub
+license, and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/ChangeLog b/ChangeLog
new file mode 100644 (file)
index 0000000..3171574
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,5997 @@
+commit 76b1d58a9791257fa8b4e6d3322fcb082c86b18a
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Mar 7 20:39:09 2012 +1000
+
+    evdev 2.7.0
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 224a28de25fda654040a9fd4e5c4d748c9e29809
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Jan 25 16:03:34 2012 +1000
+
+    Only force REL_X/Y if no ABS_X/Y exists
+    
+    5c5b2c8db851df7921cedd888222a6630a007fd8 added forced x/y axes if a device
+    has any axes of the same mode. This was too broad a brush, some devices have
+    a relative wheel but absolute x/y axes and would now get misdetected as
+    purely relative device.
+    
+    Only force relative axes if a device no rel x/y _and_ no abs x/y.
+    
+    Reproducible: virtual machine with QEMU USB Tablet will stop working
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
+
+commit bc2f01ab838119a962f5e5eabb36e33d4c084f2c
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Thu Jan 19 14:17:34 2012 -0800
+
+    Copy last valuator values into new touch valuator masks
+    
+    Evdev is a 100% stateful protocol. The following represents three
+    touches. Two touches begin and end at the same time at (500, 500) and
+    (1000, 1000). The third touch begins after the first two end, and is at
+    (500, 500).
+    
+    ABS_MT_SLOT                0       /* Set touch slot */
+    ABS_MT_TRACKING_ID 0       /* New touch with ID 0 in slot 0 */
+    ABS_MT_POSITION_X  500     /* Initial X position */
+    ABS_MT_POSITION_Y  500     /* Initial Y position */
+    ABS_MT_SLOT                1       /* Set touch slot */
+    ABS_MT_TRACKING_ID 1       /* New touch with ID 1 in slot 1 */
+    ABS_MT_POSITION_X  1000    /* Initial X position */
+    ABS_MT_POSITION_Y  1000    /* Initial Y position */
+    SYNC                               /* End of frame */
+    ABS_MT_SLOT                0       /* Go back to slot 0 */
+    ABS_MT_TRACKING_ID -1      /* Touch in slot 0 ended */
+    ABS_MT_SLOT                1       /* Go to slot 1 */
+    ABS_MT_TRACKING_ID -1      /* Touch in slot 1 ended */
+    SYNC                               /* End of frame */
+    ABS_MT_SLOT                0       /* Go back to slot 0 */
+    ABS_MT_TRACKING_ID 2       /* New touch in slot 0 with ID 2 */
+    SYNC                               /* End of frame */
+    ABS_MT_TRACKING_ID -1      /* Touch in last slot (0) ended */
+    SYNC                               /* End of frame */
+    
+    Note that touch 2 has the same X and Y position as touch 0. This is
+    implied because no new value was emitted for slot 0. In fact, Linux will
+    not emit an event in the same slot with the same event type and code
+    unless the value has changed. Thus, we can only assume that all the MT
+    valuators have the same values as they were when they were last sent for
+    the given slot.
+    
+    This change adds an array of valuator mask to hold all the last valuator
+    values that came from evdev for each slot. When a new touch begins, all
+    the last values are copied into it.
+    
+    This patch assumes initial axis values of 0 in each slot. Linux and
+    mtdev do not provide a facility to query the current values of axes in
+    each slot yet. This may cause spurious incorrect touch valuator values
+    at the beginning of an X session, but there's nothing we can do about it
+    right now.
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9d9c9870c88f2c636799a68cde8efcab59a4a2a5
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Jan 13 09:51:36 2012 +1000
+
+    Prefere relative axis labelling over absolute axis labelling
+    
+    If a device has both relative and absolute axes, we'd initialise the
+    relative axes but label them with the absolute labels.
+    
+    The current code is broken for mixed mode devices. Most of these devices
+    operate primarily in relative mode, but have some absolute axes available
+    for secondary functionality. For now, label the relative axes properly. We
+    can fix the absolute axes later.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
+
+commit 5c5b2c8db851df7921cedd888222a6630a007fd8
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jan 12 11:03:30 2012 +1000
+
+    Force x/y axes to exist on devices with any other axes (#44655)
+    
+    Too much in the server relies on x/y to exist and to be axes 0 and 1. So if
+    any relative axes exist, initialize REL_X/Y or ABS_X/Y as well.
+    
+    For servers up to 1.11: a scrollwheel-only device now has relative axes
+    where it only had buttons before.
+    
+    For servers 1.12 or later: the device now has x/y in addition to the scroll
+    axes.
+    
+    X.Org Bug 44655 <http://bugs.freedesktop.org/show_bug.cgi?id=44655>
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
+    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit 854df75f4908bee66e1057f6f04817a1c47124bc
+Author: Pete Beardmore <pete.beardmore@msn.com>
+Date:   Mon Jan 9 23:47:45 2012 +0000
+
+    missing multitouch related define tests
+    
+    addition of two missing define tests required when no multitouch related
+    symbols are available in user-space
+    
+    Fixes X.Org Bug 44578 <https://bugs.freedesktop.org/show_bug.cgi?id=44578>
+    
+    Signed-off-by: Pete Beardmore <pete.beardmore@msn.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 8c55e94a6ac91fa856d37206c8a7eda1adcc6b9d
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Tue Jan 3 15:31:43 2012 -0800
+
+    Set the default resolution to 0
+    
+    If we don't know the resolution, set it to 0. This is invalid, and tells
+    the X client that we don't know the resolution, rather than reporting an
+    incorrect value.
+    
+    This value was originally from commit
+    6271494faa4c45f4fa10509f72e0515f2cef36c6, which is the initial commit
+    from Adam Jackson adding absolute axis support.
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 965338e9d0ee5e2a6135a930347e9dab4b8db0dd
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Jan 3 08:44:27 2012 +1000
+
+    Remove unused udev.c
+    
+    Added in 683a55e504f4fc2d1c847c54986439a0c61b2f20 due to a botched up
+    rebase -i. The contents of udev.c and EvdevIsVirtual are identical, there is
+    no need for an extra file for this one function.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 0075da20d691e451f32bdf3c8ba0f270a6c8b0e1
+Author: Cyril Brulebois <kibi@debian.org>
+Date:   Sat Dec 31 19:46:08 2011 +0100
+
+    configure.ac: Fix udev/libudev dependency.
+    
+    In 683a55e504f4fc2d1c847c54986439a0c61b2f20, a dependency on libudev was
+    added, but documented in configure.ac as a dependency on udev (which
+    also happens to ship a pkg-config file).
+    
+    Signed-off-by: Cyril Brulebois <kibi@debian.org>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 009ac94a8e6d084c13f15ed8b2e1b22f86530c9f
+Author: Jeremy Huddleston <jeremyhu@apple.com>
+Date:   Sat Dec 31 21:28:53 2011 -0500
+
+    Remove redundant redeclaration of Evdev3BEmuPreInit
+    
+    Found-by: Tinderbox
+    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit 4b76d80e934f5503c712289ce73d4e10cc79bba6
+Author: Cyril Brulebois <kibi@debian.org>
+Date:   Sat Dec 31 18:38:30 2011 +0100
+
+    evdev 2.6.99.901
+    
+    Signed-off-by: Cyril Brulebois <kibi@debian.org>
+
+commit 6dd6f2d3c6b2fee5f78b01618643c7f3ed0819c3
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Dec 29 10:37:38 2011 +1000
+
+    Require xserver 1.12 RC1
+    
+    Remove the ABI check hack, just check for the server version directly now
+    that we have one that definitely has the multitouch APIs.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 0c7c087f77132657dd8ee342963bb1b51d659571
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Dec 29 10:19:48 2011 +1000
+
+    Test for mtdev before assuming multitouch
+    
+    If the XI2.2 headers are present but mtdev isn't, build without MULTITOUCH
+    defined.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit ba9377c6d9e6d0d2813e471b516bb36902dae2ce
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Sat Dec 24 12:19:40 2011 +1000
+
+    Remove need for --enable-multitouch
+    
+    If we spot inputproto 2.1.99.3, we assume we have a capable X server. This
+    should really be a server version check, but the server version hasn't been
+    bumped yet.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 7f7606fc461dca1f087a756c85e22f2cc773d008
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Sat Dec 24 12:31:34 2011 +1000
+
+    Include config.h from evdev.h
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 0ba58f483e564bd815bae36f6272029693c1fd5c
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Sat Dec 24 12:18:16 2011 +1000
+
+    Always include mt_mask in the evdev struct
+    
+    Even if MT support isn't available, include it in the build. The checks in
+    the code check whether mt_mask is non-NULL but they would all need ifdef
+    escaping otherwise.
+    
+    Leave the mtdev part inside the ifdef however, so that we don't need the
+    mtdev header if we don't build with multitouch.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 5fb48757477b2effd69c8fe8722ad95b21dbf7f5
+Merge: 7909975 e99ab23
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Dec 23 08:16:54 2011 +1000
+
+    Merge branch 'multitouch'
+
+commit e99ab2314f712df8dd705b16008755f8b3095707
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Dec 20 15:08:06 2011 +1000
+
+    Don't count legacy and MT axes twice
+    
+    The kernel exports both ABS_X and ABS_MT_POSITION_X (and a couple others)
+    for a multi-touch capable device. For such devices, only count the axis once
+    since we submit ABS_MT_POSITION_X through ABS_X.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 191660189a01b9c96bb4c0fa1a2e5008ae666238
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Dec 20 14:14:16 2011 +1000
+
+    Add is_blacklisted_axis() helper
+    
+    The kernel exports a bunch of information as axis that shouldn't be an axis
+    and we don't treat it as axis in the server. Add this helper instead of
+    checking for the axis codes manually.
+    
+    No function change.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit a1c3f8efbbff7f93e216ccdb32bd176a8ba33b09
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Dec 20 13:32:06 2011 +1000
+
+    Drop now-unnecessary XI 2.1 and XI 2.2 error suppression defines
+    
+    Gone since inputproto 2.1.99.3
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit f3c628acc4f7399325756590cdc72e769341243c
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Dec 20 10:56:22 2011 +1000
+
+    Map ABS_MT_POSITION_X/Y into ABS_X/Y
+    
+    MT axes are the same as traditional axes, so one into the other so we get
+    x/y coordinates regardless wich axes it comes from.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 7909975b0b965fbf0935bf012987a5368ea0e67a
+Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
+Date:   Thu Dec 15 12:26:37 2011 -0200
+
+    Fix relative events with swapped axes
+    
+    After we swap the axes, we only call valuator_mask_set for axes that are
+    not zero, so we need to unset the axes that became zero when swapped.
+    
+    Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 8d6dfd13b0c4177305555294218e366a6cddc83f
+Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
+Date:   Wed Dec 14 15:23:36 2011 -0200
+
+    Fix absolute events with swapped axes
+    
+    We were correctly swapping the valuator values, but we were not
+    calling valuator_mask_unset() when needed, so the cursor kept jumping
+    to the edges.
+    
+    This patch does the swapping before the main "for", so we don't need to
+    store unswapped_{x,y} and unswapped_isset_{x,y} even when we don't need
+    to swap.
+    
+    Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit fed454192ddc4ad94226040c657deb6abea3df88
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Dec 15 08:55:32 2011 +1000
+
+    Use xf86InitValuatorAxisStruct, the touch-specific version was dropped
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit cf93a21df1dd66118d3a1f5a0769d48f317de749
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Tue Nov 29 18:02:58 2011 -0800
+
+    Don't send pointer events for multitouch touchscreen devices
+    
+    Pointer events will be emulated by the server.
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+
+commit fac1a41c75a7c4bfabff34dc8ed1dff2587c6011
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Nov 11 15:57:26 2011 +1000
+
+    Add the required defines to compile against the inputproto
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 3175a2a96d448a0b2584a58ab3d05fbebb11fab1
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Nov 2 09:53:34 2011 +1000
+
+    Print to the log if we find multitouch axes.
+    
+    No real effect on the code, but it helps to have that line in the log when
+    searching for driver issues.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 5e9b027807cc205dc9c4efbb8360ac4b20317682
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Oct 31 08:58:18 2011 +1000
+
+    Replace 0/1 button values with enums
+    
+    BUTTON_PRESS is much harder to confuse with a button number than a simple 1.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 2ce305129ca94394096f4d697d51eb120de2940b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Oct 26 13:21:18 2011 +1000
+
+    Skip event posting for empty slots.
+    
+    ABS_MT_SLOT comes before any other events. The following order of events
+    is common for protocol B devices (and mtdev):
+    
+    ...
+    EV_SYN
+    ABS_MT_SLOT        → posting here means we miss on the position information
+    ABS_MT_POSITION_X
+    ABS_MT_POSITION_Y
+    ABS_MT_SLOT
+    ABS_MT_POSITION_X
+    ABS_MT_POSITION_Y
+    EV_SYN
+    
+    Store the stot state as SLOT_EMPTY after posting an event (i.e. EV_SYN and
+    ABS_MT_SLOT) and then don't post until the next slot/syn event.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9411749f76c31a8054ded62a6fb767c8135b4d4e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Oct 26 13:09:30 2011 +1000
+
+    Replace open_slot/close_slot with a SlotState enum
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 239e972be1f2c6a984dd6c5aecce710d0b866257
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Oct 26 11:14:04 2011 +1000
+
+    Simplify a condition, only the event type differs here
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 6127923fe0d50cb9b9ac4ae0a3876ba6f180137c
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Oct 26 10:51:16 2011 +1000
+
+    When resetting the queue, don't reset the touchMask
+    
+    Otherwise we segfault after the first SYN event
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit fc4f98153c2608389d87e37316036a31fb1021e7
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Oct 26 09:59:34 2011 +1000
+
+    MT axes are counted separately, make sure they're initialized too.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit fabee66bcc7260ec50c3091be3f9b503eea65e61
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Oct 25 15:06:38 2011 +1000
+
+    0 is the value for "unknown/unlimited" number of touches
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 91d90a79593369ba1079d06a75f09ceaa9143768
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Oct 25 14:55:47 2011 +1000
+
+    Use mtdev API to allocate/free mtdev structs
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit c1b89bda12c1897120bace941625cfa27e547458
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Oct 25 14:52:26 2011 +1000
+
+    Remove duplicate line
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 907b7cad3fd892ca3349cd18e9ccdc5659027b40
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Thu Dec 2 18:01:41 2010 -0500
+
+    Ensure touchpad events are always processed with MT
+    
+    Without this change, an MT touchpad in relative mode could end a touch
+    while not resetting the oldMask used to calculate relative values. This
+    fix allows a Magic Trackpad to behave as a relative mode device again.
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+
+commit c9a2b4e9ce9b15e57241184df78c72ec8f6a4705
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Mon Nov 8 14:35:02 2010 -0500
+
+    Use MTDev for multitouch devices
+    
+    MTDev translates all multitouch devices to the slotted evdev protocol.
+    This provides a clean and uniform interface and reduces message handling
+    inside the input module and X.
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+
+commit e18abd0049421a98e61c15c2d56cfe2821cf4739
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Mon Nov 8 11:08:01 2010 -0500
+
+    Add experimental XI 2.1 multitouch support
+    
+    This multitouch addition only supports slotted MT evdev protocol
+    devices. Support must be enabled at configure time using
+    --enable-multitouch.
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+    
+    Amendments: XI_TouchMotion -> XI_TouchUpdate, rename mtMask to mt_mask
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 683a55e504f4fc2d1c847c54986439a0c61b2f20
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Oct 25 09:59:50 2011 +1000
+
+    Use a new "Virtual Device" boolean property to mark virtual devices
+    
+    Use udev to check for the device's sysfs path, if it contains LNXSYSTM it's
+    a kernel-emulated device. This property can then be used to determine if
+    there are any real devices connected, allowing the desktop environment to
+    e.g. turn off the touchpad whenever there's a mouse attached.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit a9cdb6590cdf72917cdfeb17e2fcc6a110b2c7d1
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Nov 11 07:31:02 2011 +1000
+
+    Move misplaced #endif caused by smooth-scrolling merge
+    
+    Bad conflict resolution in xf86-input-evdev-2.6.0-30-g745fca0
+    
+    Reported-by: Sebastian Glita <glseba@yahoo.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit dd000dd4fa118529809632e610a0a439d7467096
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Nov 9 16:04:06 2011 +1000
+
+    Bump to 2.6.99
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 745fca03a20117583bc18c7134583311ff52c29c
+Merge: eede8cc b450efd
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Nov 9 16:01:48 2011 +1000
+
+    Merge branch 'smooth-scrolling'
+    
+    Conflicts:
+       src/evdev.c
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b450efdf95999cad08de23ce069f04a66bdae24b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Aug 19 11:15:09 2011 +1000
+
+    Support smooth scrolling on REL_WHEEL, REL_HWHEEL and REL_DIAL
+    
+    Automatic smooth scrolling setup for these axes, with REL_WHEEL and REL_DIAL
+    both mapping into vscrolling. REL_WHEEL is the preferred axis.
+    
+    Mouse wheel emulation is not yet updated for smooth scrolling.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit eede8ccffc1a831f4de89403edc8dffd52494e8b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Oct 25 15:43:38 2011 +1000
+
+    Don't crop long value from EvdevBitIsSet.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
+    Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+
+commit 2aba790ed3acc3ece5e56dac088e0a0a4a04b45d
+Author: Jools Wills <jools@oxfordinspire.co.uk>
+Date:   Sun Oct 30 23:19:21 2011 +0000
+
+    emuThird: Use xf86SetIntOption, not xf86SetBoolOption for integer values
+    
+    Signed-off-by: Jools Wills <jools@oxfordinspire.co.uk>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 49693892ce35e95674fbb3d2a067c8fa0227da87
+Author: Max Schwarz <Max@x-quadraht.de>
+Date:   Mon Oct 17 21:01:22 2011 +0200
+
+    type-safe inline functions for bitmask manipulation
+    
+    We can't use BitIsSet/SetBit from the server (inputstr.h) since they
+    operate on byte arrays. EvdevSetBit is added in preparation for the
+    "smooth-scrolling on wheel emulation" patch.
+    
+    Signed-off-by: Max Schwarz <Max@x-quadraht.de>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 070f30e08956e7fa8b7f9ca6b94fee3ef39caa1e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Aug 15 11:34:12 2011 +1000
+
+    Exit axis labelling if axes are neither rel nor abs
+    
+    No actual effect since labels_len is always 0 anyway but let's make the
+    return more explicit.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit ffe35b6c2566fc2a3f418185a61a12c7f377affd
+Author: Terry Lambert <tlambert@chromium.org>
+Date:   Fri Jul 15 17:23:20 2011 -0700
+
+    xf86-input-evdev: Return proper default for unknown values in pInfo->device_control.
+    
+    Signed-off-by: Terry Lambert <tlambert@chromium.org>
+    Reviewed-by: Stephane Marchesin <marcheu@chromium.org>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 5069e053354ad6adfcbb08c962bff93b607dec3d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri May 27 16:20:03 2011 +1000
+
+    Remove unused misc_label and val
+    
+    evdev.c: In function 'EvdevInitAxesLabels':
+    evdev.c:2192:11: warning: variable 'misc_label' set but not used
+    [-Wunused-but-set-variable]
+    obsolete with 880ad1e19afd83ac115948b67d4049e16cb12df0
+    
+    emuWheel.c: In function 'EvdevWheelEmuPreInit':
+    emuWheel.c:252:10: warning: variable 'val' set but not used
+    [-Wunused-but-set-variable]
+    obsolete with b0737bdbd1f6e601eb4984b6f4cb49279190984c
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit 0b9fad23a3d464ac064521d0e29f036b0ffdc9b8
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri May 27 16:17:12 2011 +1000
+
+    Print abs axes ranges on verbosity 6.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit b79776cf8caa2b8db2984177661698da862befa6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Jun 15 10:22:39 2011 +1000
+
+    Require server 1.10
+    
+    We require ABI 12.2 in the driver, enforce it through pkg-config.
+    Technically ABI 12.2 is first available in 1.9.99.902 but 1.10 looks so much
+    nicer.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit a52cd1cab2ae84442758de5155c5ec1417a7d16d
+Author: Daniel Kurtz <djkurtz@google.com>
+Date:   Tue Jun 14 18:09:00 2011 +0800
+
+    Set prop_product_id undeletable
+    
+    prop_invert was accidentally being set undeletable twice.
+    
+    Signed-off-by: Daniel Kurtz <djkurtz@google.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit eaf202531f2bb2b3da6d4769769f76da5489ae68
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Jan 31 14:11:44 2011 +1000
+
+    Export device node as property.
+    
+    There is currently no mapping between XI devices and physical devices other
+    than what can be extracted by parsing the Xorg logfile. Add new property
+    "Device Node" to the driver to export the open device file.
+    
+    Server 1.11 and later standardises on this property name.
+    
+    The client is responsible for detecting if the device is on the same host
+    and converting the data into a more useful format (e.g. sysfs path).
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 74151b3c52d989208c6ec8acadadd9bcf063bcc5
+Author: Peter Korsgaard <jacmet@sunsite.dk>
+Date:   Tue May 24 09:44:05 2011 +0200
+
+    Handle touchscreens without BTN_TOUCH
+    
+    Some touchscreens (like the Lumio crystaltouch in single touch mode) send
+    BTN_LEFT rather than BTN_TOUCH:
+    
+    Input driver version is 1.0.1
+    Input device ID: bus 0x3 vendor 0x202e product 0x5 version 0x111
+    Input device name: "LUMIO Inc LUMIO CrystalTouch ver 1.1C"
+    Supported events:
+      Event type 0 (Sync)
+      Event type 1 (Key)
+        Event code 272 (LeftBtn)
+        Event code 273 (RightBtn)
+        Event code 274 (MiddleBtn)
+      Event type 2 (Relative)
+        Event code 9 (Misc)
+      Event type 3 (Absolute)
+        Event code 0 (X)
+          Value    650
+          Min        0
+          Max     4095
+        Event code 1 (Y)
+          Value   3221
+          Min        0
+          Max     4095
+      Event type 4 (Misc)
+        Event code 4 (ScanCode)
+    Testing ... (interrupt to exit)
+    Event: time 1305882024.934011, type 4 (Misc), code 4 (ScanCode), value 90001
+    Event: time 1305882024.934017, type 1 (Key), code 272 (LeftBtn), value 1
+    Event: time 1305882024.934029, type 3 (Absolute), code 0 (X), value 270
+    Event: time 1305882024.934034, type 3 (Absolute), code 1 (Y), value 1513
+    Event: time 1305882024.934039, type 2 (Relative), code 9 (Misc), value 1
+    
+    This causes evdev to handle these device as a mouse rather than a
+    touchscreen, which naturally doesn't work very well. We already internally
+    translate BTN_TOUCH as BTN_LEFT, so accept this kind of devices as
+    touchscreens by checking for devices with BTN_LEFT, absolute X/Y and NO
+    relative X/Y axes.
+    
+    Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit e9d96e87acbd79b22837ac4b225ceb0bd0e1942e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed May 18 12:20:19 2011 +1000
+
+    Add a property to toggle function key mode
+    
+    On some keyboards, the multimedia function keys are overlaid with the F
+    keys. This property enables clients to switch the primary mode of these F
+    keys between function keys and multimedia keys.
+    Some keyboards provide an Fn key to toggle between the modes. This is
+    hardware-specific and may or may not work on any given keyboard device.
+    
+    The current imlementation is only hooked up to apple keyboards.
+    The kernel provides a tweak to enable/disable.
+    
+    /sys/module/hid_apple/parameters/fnmode
+        0 .. keyboard sends Fx keys, Fn disabled
+        1 .. keyboard sends multimedia keys, Fn toggles to function keys
+        2 .. keyboard sends function keys, Fn toggles to multimedia keys
+    
+    If fnmode is on 0, we force it to 2.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Michel Dänzer <michel@daenzer.net>
+
+commit bb15bac149411a2066eca6ddd50e2ca2cc38f7c8
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed May 18 12:20:00 2011 +1000
+
+    Export product/vendor ID through a property.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit 7611d2fc7357c44f56fed174d90681d5128f99e3
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed May 18 12:19:24 2011 +1000
+
+    Move invert variable to the block it is used in.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit ebe41bfba77ba9c95d990d47d5e8f5a8a4f7477e
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Fri Apr 15 12:14:03 2011 -0400
+
+    Copy out of proximity values into current values selectively
+    
+    Otherwise, an event that causes us to go into proximity with some new
+    valuator values will retain some old valuator values from when last in
+    proximity. This change ensures that all values posted while out of
+    proximity are accounted for.
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 68a6a18fc2fe1d95c9196c1948a27f9e95029bec
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Mon Apr 4 09:40:14 2011 -0400
+
+    Ensure all known valuator values are stored when out of proximity
+    
+    The current code overwrites *all* the stored axis values with whatever
+    came in from evdev. Evdev is a stateful protocol, so it only sends us
+    updates to the axis values that have changed. We need to only update
+    the values that have changed.
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit eeacd3e5a8bbd797776f27e18d8ed68aa95a8823
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Mon Apr 4 09:40:13 2011 -0400
+
+    Ensure events are posted when entering into proximity
+    
+    Fixes LP: #736829 (https://bugs.launchpad.net/bugs/573006)
+    
+    Re-fixes old X.Org Bug 29645
+    <http://bugs.freedesktop.org/show_bug.cgi?id=29645>
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 5708e384942a7257257fbae8b1d64548fd6559a0
+Author: Simon Thum <simon.thum@gmx.de>
+Date:   Sun Mar 20 15:49:48 2011 +0100
+
+    rename valuator init functions
+    
+    Since the mode of valuators (no longer?) bears a relation to the device class
+    actually initialized, this naming was quite misleading.
+    
+    Signed-off-by: Simon Thum <simon.thum@gmx.de>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 41111ce1efc6181b8da042c5b01f01cdf92315be
+Author: Rami Ylimäki <rami.ylimaki@vincit.fi>
+Date:   Tue Mar 8 11:23:47 2011 +0200
+
+    Remove constness of device filename to avoid warning when freed.
+    
+    A warning from free() can be avoided by casting the constness away
+    from its argument pointer or by not declaring the pointer as const in
+    the first place.
+    
+    Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b4c47d5f9454a708a5ab161c015646f2ca6e1ac3
+Author: Rami Ylimäki <rami.ylimaki@vincit.fi>
+Date:   Tue Mar 8 11:23:46 2011 +0200
+
+    Release leaked device identifier on input device disconnect.
+    
+    Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
+    Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 50193a0dd35b6f54499fb76ab68f615237cc51f9
+Author: Rami Ylimäki <rami.ylimaki@vincit.fi>
+Date:   Tue Mar 8 11:23:45 2011 +0200
+
+    Release leaked XKB options on input device disconnect.
+    
+    Currently the XKB options duplicated in EvdevAddKeyClass are never
+    released. For example, connecting and disconnecting a bluetooth
+    keyboard repeatedly causes a steadily growing memory leak.
+    
+    Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
+    Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 0049cce4d0691f055dfe9059e4c0c4ad30301db6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Feb 11 13:31:52 2011 +1000
+
+    Use Absolute/Relative as argument to xf86Post*
+    
+    xf86Post* takes an int for the is_absolute parameter. Since the XI protocol
+    spec requires Relative to be 0 and Absolute to be 1, use those instead to
+    make the code easier to read.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit d9001a6be9d86a5f30549af9fbb02a466f4b0709
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Jan 26 12:11:00 2011 +1000
+
+    Add third button emulation.
+    
+    New properties:
+    "Evdev Third Button Emulation" → switch on/off
+    "Evdev Third Button Emulation Timeout" → timeout until event is delivered
+    "Evdev Third Button Emulation Button" → phys button to be emulated
+    "Evdev Third Button Emulation Threshold" → move threshold before emulation
+    is cancelled
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Tested-by: Benjamin Tissoires <tissoire@cena.fr>
+
+commit 22db196815b813ff1c4806dd4cbb06788763d6b6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Jan 31 13:39:46 2011 +1000
+
+    Static atoms don't need to be initialized to 0.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 54ac2306b83434a014e941e25a5286a592e74351
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Jan 31 12:07:48 2011 +1000
+
+    Replace xf86Msg() with xf86IDrvMsg().
+    
+    The latter provides a standardised message format in the form of
+        driver name: device name: message
+    
+    making it easier to grep for driver messages in the log.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 768c25a99b2f4ec07993eb15a0f05a5e22b5c695
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Mon Jan 24 11:49:05 2011 -0500
+
+    Add support for masked valuators
+    
+    With the X server now supporting masked valuators for XI2, enable
+    support in X evdev.
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b5c9f41b2b6c680b7c44eadef8da855b1d9adcb7
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Sat Jan 22 16:40:49 2011 -0500
+
+    Switch to "goto" logic for error handling when adding classes
+    
+    This will be necessary for the addition of multitouch functionality.
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 8bc4be3048754b9c751cd98f5a5b46cf59a56f3a
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Sat Jan 22 16:40:48 2011 -0500
+
+    Remove support for X input ABI < 12.2
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 30c3645e20e945b0f8b7dc624748948464be606e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Jan 11 12:46:40 2011 +1000
+
+    evdev 2.6.0
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 3b52fe2ea4a934a8d87aacd185593beb01f8f273
+Author: Chase Douglas <chase.douglas@canonical.com>
+Date:   Wed Jan 5 10:09:55 2011 -0500
+
+    Print out error messages when failing to init devices
+    
+    Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 540a4cce9071fce183c941ded35e7e8fb8f3507e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Jan 5 09:04:56 2011 +1000
+
+    evdev 2.5.99.903
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit bed25600f66db245b895a48d6edca30568ca7559
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Dec 23 12:13:16 2010 +1000
+
+    Don't update first_val and num_val if we don't have data (#32480)
+    
+    For touchpads, rel_queued may be on (due to abs to rel conversion) but the
+    delta for x/y is 0/0 on the first touch. Hence, we don't have any valuators
+    to post. The current results in a num_vals of -15 and a subsequent segfault
+    when the data is posted to the server.
+    
+    Start with a last valuator of -1, so that we know if we have at least one to
+    post.
+    
+    X.Org Bug 32480 <http://bugs.freedesktop.org/show_bug.cgi?id=32480>
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
+
+commit 9aea1c5fa09c25ad83bcf2fd4ee4bd853d889e5e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Dec 21 10:53:06 2010 +1000
+
+    Add use_proximity bit for BTN_TOOL handling.
+    
+    Touchpads send garbage data between BTN_TOOL_FINGER and BTN_TOUCH. This
+    leads to cursor movement towards invalid positions (bottom left corner,
+    usually).
+    
+    Add a new flag "use_proximity" as a delimiter for BTN_TOUCH handling. If
+    unset, the actual proximity bits are ignored, no proximity events are sent
+    and BTN_TOUCH is used for the tool handling.
+    
+    Example event stream for synaptics:
+    
+    Event: time 1292893041.002731, -------------- Report Sync ------------
+    Event: time 1292893041.015807, type 1 (Key), code 330 (Touch), value 0
+    Event: time 1292893041.015812, type 3 (Absolute), code 0 (X), value 4283
+    Event: time 1292893041.015813, type 3 (Absolute), code 1 (Y), value 4860
+    Event: time 1292893041.015815, type 3 (Absolute), code 24 (Pressure), value 23
+    Event: time 1292893041.015817, type 3 (Absolute), code 28 (Tool Width), value 5
+    Event: time 1292893041.027537, -------------- Report Sync ------------
+    Event: time 1292893041.038854, type 3 (Absolute), code 0 (X), value 1
+    Event: time 1292893041.038857, type 3 (Absolute), code 1 (Y), value 5855
+    Event: time 1292893041.038859, type 3 (Absolute), code 24 (Pressure), value 1
+    Event: time 1292893041.038861, type 3 (Absolute), code 28 (Tool Width), value 5
+    Event: time 1292893041.038864, -------------- Report Sync ------------
+    Event: time 1292893041.062432, type 3 (Absolute), code 24 (Pressure), value 0
+    Event: time 1292893041.062435, type 3 (Absolute), code 28 (Tool Width), value 0
+    Event: time 1292893041.062437, type 1 (Key), code 325 (ToolFinger), value 0
+    Event: time 1292893041.062438, -------------- Report Sync ------------
+    
+    Reported-by: Dave Airlie <airlied@redhat.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
+
+commit 0c987a929dd4c98d4a80d8b7f75286902eb572f2
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Dec 21 10:45:11 2010 +1000
+
+    Revert "Don't count BTN_TOUCH as tool. (#29428)"
+    
+    Synaptics devices send garbage between BTN_TOUCH and BTN_TOOL_FINGER. By
+    switching to use this as proximity data now, the pointer is reset to the
+    garbage data position (usually around 1/5855).
+    
+    This reverts commit 899218e18120918138f6d7420465763422d5b3b7.
+    
+    Reported-by: Dave Airlie <airlied@redhat.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
+
+commit 242a01eb0f2f9b56fb6d6f0b41fc6a899cadb857
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Dec 21 10:40:45 2010 +1000
+
+    Rename proximity to in_proximity.
+    
+    No functional change, just making it a bit more obvious to read.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
+    Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
+
+commit 7415953b9afac3221d1bb834aadcc7c1917366fd
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Dec 21 10:44:14 2010 +1000
+
+    Fix grammar typo in comment.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 1ced7ec7e23c57c0e1aaddeb3c113e67a5cb7341
+Author: Peter Korsgaard <jacmet@sunsite.dk>
+Date:   Fri Dec 10 16:16:59 2010 +0100
+
+    evdev: rename EvdevCacheCompare() to EvdevCache()
+    
+    Since 59056e656c64 (Remove the reopen timer logic) from last year,
+    EvdevCacheCompare() is only used for caching ioctl values and not for
+    comparing, so remove the unused compare logic and rename the function
+    to EvdevCache().
+    
+    Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
+    Reviewed-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 1c5ad6f8a0f098da89aa88102f424c667addf376
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Dec 8 12:40:49 2010 +1000
+
+    evdev 2.5.99.902
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 6fd1d0860e71c644fa72b4b40872e0ced671726c
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Dec 6 11:41:11 2010 +1000
+
+    Return error codes from EvdevOpenDevice()
+    
+    The server's behaviour is to stop adding new devices when a BadAlloc occurs
+    on any device (on the assumption that new devices won't magically have more
+    memory). Change EvdevOpenDevice() to return an error code of BadValue when
+    it fails (and thus to the server) to prevent other devices being ignored
+    because of one misconfigured one.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit 31ba99e9edd28ff81437e0167c5322b9f619c52a
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Nov 19 14:27:09 2010 +1000
+
+    evdev 2.5.99.901
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit a4aefca2ed52e675e6151a0fb0742a9e19565a41
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Oct 25 11:05:18 2010 +1000
+
+    Reshuffle to avoid the need for XI86_CONFIGURED.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
+
+commit 20d7a0a4aab64232712186811ae55c40d2b7d161
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Oct 25 10:38:21 2010 +1000
+
+    Input API 12 requires a valuator mode for each axis.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
+
+commit 5e26ba8641809addc63e783e1cefac0f8524b020
+Author: Nikolai Kondrashov <spbnick@gmail.com>
+Date:   Wed Oct 20 23:31:30 2010 +0400
+
+    Extend button mapping to full ranges
+    
+    Extend button code to number mapping to cover full BTN_MOUSE and BTN_MISC
+    ranges, including undefined codes.
+    
+    This extends mapping introduced with 0367e387 to the following:
+    
+            1       BTN_LEFT        BTN_0       BTN_TOUCH
+            2       BTN_MIDDLE      BTN_1       BTN_STYLUS
+            3       BTN_RIGHT       BTN_2       BTN_STYLUS2
+    
+            8       BTN_SIDE        BTN_3
+            9       BTN_EXTRA       BTN_4
+            10      BTN_FORWARD     BTN_5
+            11      BTN_BACK        BTN_6
+            12      BTN_TASK        BTN_7
+            13      0x118           BTN_8
+            14      0x119           BTN_9
+            15      0x11A           0x10A
+            16      0x11B           0x10B
+            17      0x11C           0x10C
+            18      0x11D           0x10D
+            19      0x11E           0x10E
+            20      0x11F           0x10F
+    
+    This should fix https://bugs.freedesktop.org/show_bug.cgi?id=30336
+    
+    Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 71dd18f72889ef6998a1bd699630da583dcb775a
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Oct 19 10:22:55 2010 +1000
+
+    Rename CountBits to EvdevCountBits.
+    
+    Avoid name collision with the server.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
+    Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
+
+commit c3e49f2b95d3e40f97d6bffdaf8a6c036093fa91
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Oct 20 10:33:39 2010 +1000
+
+    Use an array for the proximity bits.
+    
+    Instead of two lists that need to be kept in sync, just store the bits in an
+    array and run through them.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
+    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit b06d3ffdcdb14978201af5b24a7292ee73b65318
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Oct 20 10:20:26 2010 +1000
+
+    Rename abs/rel/prox to abs_queued/rel_queued/prox_queued.
+    
+    Mainly to avoid confusing between pEvdev->prox and pEvdev->proximity and to
+    better express what these fields are actually holding.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
+    Reviewed-by: Daniel Stone <daniel@fooishbar.org>
+
+commit 3646371eefae63678876f45daa0eea2ac522f2e2
+Author: Benjamin Tissoires <tissoire@cena.fr>
+Date:   Sat Oct 16 20:20:31 2010 +0200
+
+    Add the names of the valuators for the multitouch properties
+    
+    Thoses definitions have been included in the kernel and in the X server.
+    However, the evdev driver has not been updated accordingly.
+    
+    Without these definitions, the multitouch axes are not correctly labelled.
+    
+    Signed-off-by: Benjamin Tissoires <tissoire@cena.fr>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b48f4c41c0d3386bba3e9d8fa3da91f18aae190b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Oct 11 09:33:28 2010 +1000
+
+    Add proximity support.
+    
+    When one of the tools comes into proximity, queue up a proximity event and
+    send it accordingly.
+    
+    Includes special handling for tablets that do not send axes with tools
+    (#29645)
+    
+    Some tablets send axis values, then EV_SYN, and in the next event the
+    BTN_TOOL_PEN/BTN_TOUCH, etc. For these tablets, the cursor doesn't move as
+    coordinates while not in proximity are ignored.
+    
+    Buffer coordinates received while out-of-proximity and if we get a proximity
+    event without other coordinates, re-use the last ones received.
+    
+    X.Org Bug 29645 <http://bugs.freedesktop.org/show_bug.cgi?id=29645>
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
+    Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
+
+commit 185ad42078a3bcb423b83e41ebeddbb7541fe26c
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Sep 8 10:47:34 2010 +1000
+
+    Rename evdev->tool to evdev->proximity.
+    
+    evdev doesn't care about the actual tool used, only that it is used as an
+    indicator for proximity. Rename the field accordingly to make the code more
+    obvious to read.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
+
+commit 7282e3ac6c3b23cce927271fb9ca34b2acd36fd3
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Sep 8 11:30:14 2010 +1000
+
+    When posting buttons, post absolute valuators if we have them.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
+
+commit c504852aa27239a57445ca1de013b5bfefa68276
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Sep 8 11:29:11 2010 +1000
+
+    Fix valuator offset when posting absolute motion events.
+    
+    If first_v was not zero, the values passed to xf86PostMotionEventP were
+    wrong.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
+
+commit 4bbf9c9125db51394870c86413fe18a0c8ec7068
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Sep 8 11:28:27 2010 +1000
+
+    Don't pass pointers around to first_v and num_v.
+    
+    We only use them as values, no need for the addresses.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
+
+commit 684426a9d2b4850ae80c824d4afe1e95875eee21
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Sep 8 10:59:12 2010 +1000
+
+    De-duplicate event queue access.
+    
+    Factor out access to the next queue element in a static function to be
+    reused for button and key presses.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Benjamin Tissoires <tissoire@cena.fr>
+
+commit 9664e5a48723e7085fc3ece2aa13f8696f631a3d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Oct 6 10:58:17 2010 +1000
+
+    Remove refcnt initialization from InputDriverRec.
+    
+    Removed from the server with
+    commit 6130170e7e9b64c611ee942ec3455dd1a185193d
+    Author: Adam Jackson <ajax@redhat.com>
+    Date:   Sat Sep 18 06:41:35 2010 -0400
+    
+        xfree86: Remove unused refcounting from input drivers
+    
+    And given that it was unused, we don't need to ifdef it.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 0367e3871f02993b4ce04873d6e40df16fb0a202
+Author: Nikolai Kondrashov <spbnick@gmail.com>
+Date:   Thu Sep 2 18:09:13 2010 +0400
+
+    Clean up button code to number mapping
+    
+    Now BTN_MOUSE, BTN_MISC and BTN_DIGI button ranges are all mapped to the
+    same lower numbers including first three, corresponding to the LMR mouse
+    buttons. Like this:
+    
+        1       BTN_LEFT        BTN_0       BTN_TOUCH
+        2       BTN_MIDDLE      BTN_1       BTN_STYLUS
+        3       BTN_RIGHT       BTN_2       BTN_STYLUS2
+    
+        8       BTN_SIDE        BTN_3
+        9       BTN_EXTRA       BTN_4
+        10      BTN_FORWARD     BTN_5
+        11      BTN_BACK        BTN_6
+        12      BTN_TASK        BTN_7
+        13                      BTN_8
+        14                      BTN_9
+    
+    This streamlines the button mapping under the assumption that these ranges
+    don't generally appear in a single device simultaneously. If they do appear,
+    they will simply report overlapping button numbers.
+    
+    Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 617a09e298768d0a1d33cb6b367410455489e8b8
+Author: Nikolai Kondrashov <spbnick@gmail.com>
+Date:   Tue Sep 7 10:38:20 2010 +1000
+
+    Add BTN_TOUCH/STYLUS/STYLUS2 support.
+    
+    These three buttons are mapped into buttons 1/2/3, respectively.
+    Overlapping range with BTN_LEFT/MIDDLE/RIGHT, assuming that these
+    ranges don't generally appear in a single device simultaneously.
+    
+    Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b83515485b739451b6cde29c7e6f5c900175eaf9
+Author: Tim Yamin <plasm@roo.me.uk>
+Date:   Tue Sep 7 10:31:02 2010 +1000
+
+    SwapAxes should rescale raw values when enabled
+    
+    Current implementation assumes that X & Y axes have the same min and max
+    values. If they don't, you'll end up with funny behaviour if SwapAxes is
+    turned on.
+    
+    Signed-off-by: Tim Yamin <plasm@roo.me.uk>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 009d442aa347cea15d07ceaec955a2f69f247364
+Merge: 10493de 4964c61
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Sep 1 13:04:29 2010 +1000
+
+    Merge branch 'input-api' of git://people.freedesktop.org/~whot/xf86-input-evdev
+
+commit 10493de96e905b831e14bd510f2af1b8da3d2be6
+Author: Nikolai Kondrashov <spbnick@gmail.com>
+Date:   Tue Aug 31 11:31:07 2010 +0400
+
+    Improve dumb tablet detection
+    
+    Improve dumb tablet detection by checking if BTN_STYLUS or BTN_STYLUS2
+    (first or second pen barrel button) is present when BTN_TOOL_PEN is not
+    found.
+    
+    This enables detection of tablets without explicit tool proximity reporting.
+    These include at least four UC-Logic tablet models: WP4030U, WP5540U,
+    WP8060U and PF1209, on which many Genius and Trust models are based.
+    
+    Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 829facd516d90f92187b78ccf6d921a1b1671990
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Aug 31 14:09:46 2010 +1000
+
+    Bump to 2.5.99.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit fbafe59420f128b6264feeb115bbcbc1c933f611
+Author: Nikolai Kondrashov <spbnick@gmail.com>
+Date:   Wed Aug 25 00:39:45 2010 +0400
+
+    Fix comments about BTN_TOOL_PEN.
+    
+    Fix incorrect usage of BTN_DIGI instead of BTN_TOOL_PEN in comments.
+    Fix forgotten pEvdev->digi reference.
+    
+    Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 990540fa1905b11403d5c25345c428c5bc9ed126
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Aug 23 10:34:36 2010 +1000
+
+    evdev 2.5.0
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b8945e61eb97265fdccace8411b8b33d3d56be13
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Aug 23 10:27:35 2010 +1000
+
+    man: don't reference README.mouse
+    
+    No real reason to refer to the mouse driver's readme.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 97dc45b769c9a4dfa61782d7ce491df8ebaed3dc
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Aug 19 12:50:25 2010 +1000
+
+    evdev 2.4.99.901
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit ec6cb31cc47eed3ccba4c906ca6c54b99136e9eb
+Author: Bartosz Brachaczek <b.brachaczek@gmail.com>
+Date:   Tue Aug 10 22:31:37 2010 +0200
+
+    evdev: Initialize valuators array. (#24737)
+    
+    The array needs to be filled with zeros, otherwise we may end up sending
+    it with random values if non-zero values aren't in one row (which is the
+    case for A4Tech X-750F which sends REL_MISC events without a reason).
+    
+    X.Org Bug 24737 <http://bugs.freedesktop.org/show_bug.cgi?id=24737>
+    
+    Signed-off-by: Bartosz Brachaczek <b.brachaczek@gmail.com>
+    Tested-by: Bartek Iwaniec <hash87@gmail.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit ed47c7f33e315f163a6aebeb3e1c8947004576fd
+Author: Bartosz Brachaczek <b.brachaczek@gmail.com>
+Date:   Tue Aug 10 22:31:00 2010 +0200
+
+    evdev: Revert "Set all valuators for relative motion events (#24737)"
+    
+    It isn't necessary to post zero-deltas to X Server. In order not to post
+    uninitialized "v" array we should rather simply initialize it.
+    
+    This reverts commit c1f16a4f59a584ab4546c2f16e20b06703042057.
+    
+    Signed-off-by: Bartosz Brachaczek <b.brachaczek@gmail.com>
+    Tested-by: Bartek Iwaniec <hash87@gmail.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 899218e18120918138f6d7420465763422d5b3b7
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Aug 9 13:01:11 2010 +1000
+
+    Don't count BTN_TOUCH as tool. (#29428)
+    
+    Devices that don't have a tool but BTN_TOUCH simply have the tool always on.
+    Devices that have a tool other than BTN_TOUCH set this tool before BTN_TOUCH
+    is emitted anyway.
+    
+    X.Org Bug 29428 <http://bugs.freedesktop.org/show_bug.cgi?id=29428>
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 4964c61f4b248e9eb16e8eadb5f5d0b6410b6b84
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 22 11:32:08 2010 +1000
+
+    Return BadMatch for already configured devices.
+    
+    PreInit can now return different error codes. Return BadAlloc for alloc
+    failures and BadMatch if the device was already configured or the cache
+    comparison/probe failed.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 92e8dc49611398c8a9659b244645530cd26736fe
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 22 10:57:02 2010 +1000
+
+    Use the new input API (changed PreInit function prototype).
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit e0e4b7d89b20ab9997a2eeb17dc7381ecafa31e3
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 22 10:51:54 2010 +1000
+
+    Move private init down.
+    
+    No real change, preparation for new input API.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit d2c11d36a05e18936e39f7aa592c15b254aff1de
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 22 10:51:12 2010 +1000
+
+    Use pInfo->options instead of dev->commonOptions.
+    
+    No real change, preparation for new input API.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 2f636402d882c775497e88c1f74477c4f6e9521d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 22 10:40:01 2010 +1000
+
+    Add ifdefs for pre ABI 12 support.
+    
+    The server doesn't provide these defines anymore, define them here for
+    future use. To be purged whenever we drop support for the current server.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 3d3565c069558b9d1e8e0e86332415731b88b11d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 22 10:38:58 2010 +1000
+
+    Remove usage of XI86_POINTER_CAPABLE and XI86_KEYBOARD_CAPABLE.
+    
+    XI86_KEYBOARD_CAPABLE was write-only, both in the driver and the server.
+    XI86_POINTER_CAPABLE was write-only in the server and can be emulated with
+    has_abs_axes and has_rel_axes.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 421585fda6ce67c209d43952109dda056ee40941
+Author: Alex Warg <alexander.warg@os.inf.tu-dresden.de>
+Date:   Wed Jun 30 10:33:46 2010 +1000
+
+    Fix out-of-bounds access if more than MAX_VALUATORS are present. (#28809)
+    
+    The functions EvdevAddRelClass and EvdevAddAbsClass do out of bounds
+    accesses to vals and old_vals arrays in the EvdevRec structure if there are
+    more than MAX_VALUATORS axes reported by the kernel.
+    
+    X.Org Bug 28809 <http://bugs.freedesktop.org/show_bug.cgi?id=28809>
+    
+    Signed-off-by: Alex Warg <alexander.warg@os.inf.tu-dresden.de>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 8697811f56160146981f2364d6e154b2c57f388e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Jun 22 14:40:13 2010 +1000
+
+    man: some minor fixes to man page.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b06bffdc979eb7d1ebf10680bc9b11baf9bd34a0
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Jun 11 10:01:08 2010 +1000
+
+    Add myself to Authors in man page.
+    
+    git blames me for about half the driver now, I guess that's enough
+    justification ;)
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9410e452d26aeb81fb6068ab83ffdcd5aca32f67
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu May 27 21:56:47 2010 -0400
+
+    config: use AC_PROG_INSTALL now supplied by XORG_DEFAULT_OPTIONS
+    
+    It depends on util-macros 1.8
+    The existing statement can now be removed from the configuration file.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 516e538da4c866dde12d747095fa1779fd4275c0
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu May 27 20:51:47 2010 -0400
+
+    config: upgrade to util-macros 1.8 for additional man page support
+    
+    Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS
+    The value of MAN_SUBST is the same for all X.Org packages.
+    
+    Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS
+    The existing statement can now be removed from the configuration file.
+    
+    Use Automake $() for variables in Makefile.am
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 1f38e1bc1174a66980d4a7e8e0a36aef938625df
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sat Jun 12 09:59:06 2010 -0400
+
+    COPYING: update and refactor the Copyright notices
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 456579ba30edbda8182cc8a7f6347e591d191bd0
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Jun 1 10:20:25 2010 +1000
+
+    Bump to 2.4.99
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 21a2ac818e75ef918d320ce1e88b6263e68e598d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri May 28 09:47:17 2010 +1000
+
+    Disable middle mouse button emulation by default.
+    
+    The AUTO feature was the default, MB emulation was on until a middle mouse
+    button was pressed. MB emulation however results in a delay of the first
+    press, causing minor annoyances to the users and being generally confusing
+    when the behaviour before a button press is different to after a button
+    pres.
+    
+    Disable the feature by default instead. There's not a lot of two-button mice
+    around anymore though and the inability to detect two-button mice makes for
+    non-deterministic detection of when the emulation should be on.
+    
+    Middle button emulation can be enabled with a configuration snippet:
+    
+    Section "InputClass"
+            Identifier "middle button emulation"
+            MatchIsPointer "on"
+            Option "Emulate3Buttons" "on"
+    EndSection
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Acked-by: Daniel Stone <daniel@fooishbar.org>
+
+commit 4c216242404d749b9ae8ec181146689f89119cb4
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu May 20 12:40:13 2010 +1000
+
+    Remove libc wrappers for malloc, calloc and free.
+    
+    Evdev is Linux-only, and we've had the above calls for quite a while now.
+    Plus, now that the server has removed them they generate _a lot_ of warnings
+    otherwise.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Jamey Sharp <jamey@minilop.net>
+
+commit 6e244b109861d6f602066cac8b766a55a5016c63
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu May 20 12:38:19 2010 +1000
+
+    Move mode declaration, it's not const either.
+    
+    What we're getting back from xf86SetStrOption is a strdup'd string, not
+    const, especially given that we free it a few lines down.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit e7c301563a4b1718d2fc0066c1b3125404e3060f
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu May 20 14:24:05 2010 +1000
+
+    Move opening the device into a separate function.
+    
+    Re-use from EvdevOn and PreInit.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit ffc2c9961f5fb099b85a97550a30a854420ee773
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu May 20 11:54:56 2010 +1000
+
+    Move checks for calibration, inversion and axis swap to EvdevProbe.
+    
+    Keyboard devices don't need these checks.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 7c01cff1faede468efddf2c66c9ca85022585244
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed May 19 15:37:01 2010 +1000
+
+    Move EVIOCGRAB into a static func.
+    
+    This is in preparation of some major rework, there are no functional
+    changes.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit e6e20c1b3e5977830a2b78046c0a8c49e38746fd
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed May 19 15:09:29 2010 +1000
+
+    Move error handling in PreInit down to the end.
+    
+    Just have one exit path instead of different ones. Guards are in place to
+    avoid freeing/deleting something that shouldn't be.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Jamey Sharp <jamey@minilop.net>
+
+commit b27d03b248e36ec7a674113baa494b82e3ad728b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed May 19 14:55:32 2010 +1000
+
+    Comment odd EVIOCGRAB behaviour and reshuffle conditions a bit.
+    
+    The reason for this rather weird approach is to ungrab immediately after
+    getting a successful grab. Evdev shouldn't be hogging the device if nothing
+    is done with it.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Jamey Sharp <jamey@minilop.net>
+
+commit ba78428ed50685fd89ef4f35143a9b3f2b1ac0f6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed May 19 14:52:29 2010 +1000
+
+    Remove support for kernel 2.4.
+    
+    It's been 6 years since 2.6, I doubt evdev would even work on 2.4 right now.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Jamey Sharp <jamey@minilop.net>
+    Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
+
+commit 041a1f246a10951ca5c0fc34b0c88c4762c076bf
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon May 10 21:42:35 2010 -0400
+
+    config: AC_PROG_SED is required explicitly.
+    
+    It sets the SED env variable with an appropriate sed program path
+    It still works on some platform when not explicity called.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 44b80d177f57a5d697402e0bbb1c3bf77d5f39e6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu May 6 11:10:45 2010 +1000
+
+    Update a stale comment about the use of pEvdev->tool.
+    
+    Including some typo fixes in the same comment.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 7bbbce9a834f2549168b63d1c5993440ef325f87
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Apr 29 10:06:24 2010 +1000
+
+    Read the device resolution from the kernel.
+    
+    For earlier kernels, use the previous hardcoded resolution in place.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Julien Cristau <jcristau@debian.org>
+
+commit 35b6085bf8feb9e6d3d3020db868a6e285dec38a
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Apr 28 10:41:06 2010 +1000
+
+    config: remove AH_TOP autoheader statement.
+    
+    Include it in evdev.h instead.
+    xorg-server.h is required to define the right datatype sizes on 64 bit,
+    hence ensure that evdev.h is the first included in each file.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 539d67505cdb36018bd0e5ef01bd78939eafaadb
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Apr 22 10:50:55 2010 +1000
+
+    Revert "config: remove AH_TOP autoheader statement"
+    
+    The changed location of xorg-server.h had some side-effects.
+    See Bug 27768 <https://bugs.freedesktop.org/show_bug.cgi?id=27768>
+    
+    This reverts commit 9dbace89bee55a001e794ccf3ff36e3afeda4715.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit a77dea1caa5aa632adad10028ed86544b4bb65e1
+Merge: 993e011 5fb1e84
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Apr 20 16:31:09 2010 +1000
+
+    Merge branch 'master' of git://gitorious.org/omcfadde/xf86-input-evdev
+
+commit 5fb1e841eb26f6223504e46dacfc40c2e510f72d
+Author: Oliver McFadden <oliver.mcfadden@nokia.com>
+Date:   Tue Apr 20 06:59:58 2010 +0300
+
+    evdev: EvdevProbe: check ioctl() return value and warn on failure.
+    
+    Called function "ioctl" whose return value should be checked (checked 10
+    out of 11 times)
+    
+    Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit a4f2d12cd8fbd19d13a184c45817d7539cb7e3be
+Author: Oliver McFadden <oliver.mcfadden@nokia.com>
+Date:   Tue Apr 20 05:48:33 2010 +0300
+
+    evdev: ioctl() may return a negative value therefor use a signed integer.
+    
+    Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 6b5c0401e2b8fe1637f937739e822a33206ef1ac
+Author: Oliver McFadden <oliver.mcfadden@nokia.com>
+Date:   Tue Apr 20 05:37:39 2010 +0300
+
+    evdev: leaked_storage: free memory allocated from the xf86Option code.
+    
+    Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 993e011b91d318dcb8df76799e5102a20060a169
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sat Apr 17 18:42:29 2010 -0400
+
+    man: Use Autoconf provided $(AM_V_GEN)$(SED)
+    
+    Enables silent rule and use platform appropriate version of sed.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 2d5e922a6daacf5d6e7f93ff072842a278ceed42
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sat Apr 17 18:23:48 2010 -0400
+
+    include: EXTRA_DIST is not required for header files.
+    
+    The sdk_HEADERS is sufficient as the "sdk" prefix
+    matches the "dir" suffix in the "sdkdir" variable.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 41a38ec88608a829dc175cece79f3100671c9e84
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sat Apr 17 18:18:55 2010 -0400
+
+    config: require macros 1.4, fix warnings, m4 quotings and layout
+    
+    Fix some m4 quoting
+    Fix some autoconf warnings
+    remove AC_PROG_CC as it overrides AC_PROG_C_C99 from XORG_DEFAULT_OPTIONS
+    Regroup statements per section
+    Add comments
+    Upgrade X.Org macros to 1.4 for INSTALL file copying
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit b31c00efeaa0e3c75c0ab35458aaa322719a823f
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sat Apr 17 15:11:43 2010 -0400
+
+    config: optional extension check for inputproto not required
+    
+    The check should be in PKG_CHECK_MODULES permanently.
+    
+    The XORG_DRIVER_CHECK_EXT will add inputproto to PKG_CHECK_MODULES
+    only if the extension is available. By definition, this extension
+    is always available and the evdev driver cannot function without it.
+    
+    This is evidenced by the absence of XINPUT conditional code.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit b48dcfa3f22575840a377380fbe98e5e05e400c9
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Apr 15 13:27:14 2010 -0400
+
+    config: replace deprecated INCLUDES with AM_CPPFLAGS
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 44baa36b9904f2afdfd00769a2d15a5eb630059e
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Apr 15 13:22:31 2010 -0400
+
+    config: refactor and comment the sdkdir distcheck workaround
+    
+    Seperate legitimate sdkdir usage from distcheck workaround.
+    Comment this non obvious workaround.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 7fa5982d477351f7e4b825234bfa248363d3d183
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Apr 15 13:13:45 2010 -0400
+
+    config: remove unrequired AC_HEADER_STDC
+    
+    Autoconf says:
+    "This macro is obsolescent, as current systems have conforming
+    header files. New programs need not use this macro".
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit fe8d0fa11a1ffaf219cc66ac3c509fdc844025bd
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Apr 15 13:12:49 2010 -0400
+
+    replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS
+    
+    Regroup AC statements at the top.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 09b918db86febb8a25c0e497f1629cd245c71975
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Apr 15 13:10:58 2010 -0400
+
+    config: update AC_PREREQ statement to 2.60
+    
+    Unrelated to the previous patches, the new value simply reflects
+    the reality that the minimum level for autoconf to configure
+    all x.org modules is 2.60 dated June 2006.
+    
+    ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit 9dbace89bee55a001e794ccf3ff36e3afeda4715
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Apr 15 13:09:05 2010 -0400
+
+    config: remove AH_TOP autoheader statement
+    
+    The generated config.h does not need to include xorg-server.h
+    for the content it provides.
+    Add #include <xorg-server.h> in .[hc] files as needed.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit aaf65e7bfacd9501c4475a579d92c3bc60409893
+Author: Paulo Ricardo Zanoni <pzanoni@mandriva.com>
+Date:   Wed Apr 14 17:12:27 2010 -0300
+
+    Don't set pEvdev->rel for mouse wheel events
+    
+    This way we won't get empty MotionNotify events when the mouse wheel is
+    used.
+    
+    Signed-off-by: Paulo Ricardo Zanoni <pzanoni@mandriva.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 8eede7ea8d3e3bc3a3b0d48c89df3c5f40041ef7
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Apr 8 16:49:01 2010 +1000
+
+    Use X_PROBED instead of X_INFO for probed values.
+    
+    No functional changes, only the log output differs now.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
+
+commit 1936632cb0b777e54cef9dd58df9060155d0643e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Apr 6 10:31:16 2010 +1000
+
+    evdev 2.4.0
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 0dc931e1acee6ea3afd032be887f85ce1121f325
+Author: Simon Thum <simon.thum@gmx.de>
+Date:   Tue Mar 16 16:00:21 2010 +0100
+
+    move feedback initialization up
+    
+    This allows the backend to propery initialize the feedback from options,
+    as it works with most other drivers. This is the hacky equivalent of
+    fixing the initialization of pointer acceleration, which would require
+    changes to most drivers however.
+    
+    Signed-off-by: Simon Thum <simon.thum@gmx.de>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit d525b48a2ffeeb63fd248e21324e33156ed61ed0
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Mar 15 11:08:05 2010 +1000
+
+    When labeling a device as touchpad, only check for LMR buttons.
+    
+    Touchpads that have physical buttons have either LMR or BTN_TOOL_FINGER.
+    Other buttons in the range evdev recognises shouldn't be taken into account
+    here - they skew the detection towards touchpads and away from touchscreens.
+    
+    Fedora Bug 571639
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Reviewed-by: Simon Thum <simon.thum@gmx.de>
+
+commit 801778c3106fc7e409369b4500253a38be6a5795
+Author: Oliver McFadden <oliver.mcfadden@nokia.com>
+Date:   Thu Feb 25 07:11:21 2010 +0200
+
+    emuMB: default to disabled mouse button emulation for touchscreens.
+    
+    Because touchscreens only use one button (see EvdevProcessKeyEvent())
+    EvdevMBEmuFilterEvent() never calls EvdevMBEmuEnable(..., FALSE) to
+    disable emulation. This results in touchscreen devices incurring a delay
+    of Emulate3Timeout (typically 50 ms.)
+    
+    Default to MBEMU_DISABLED for touchscreen devices (unless overwritten by
+    Xorg.conf.)
+    
+    Signed-off-by: Oliver McFadden <oliver.mcfadden@nokia.com>
+    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 99505011d124bef00acffb6ab07f6b765f5870b7
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Feb 18 19:01:51 2010 +1000
+
+    man: fix man page formatting for option EmulateWheel.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit fd036680c210266ba535b0204cac38e503371398
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Feb 11 10:08:07 2010 -0500
+
+    config: move CWARNFLAGS from configure.ac to Makefile.am
+    
+    Compiler warning flags should be explicitly set in the makefile
+    rather than being merged with other packages compiler flags.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+
+commit e81cd935cfff18d3c387eed3e8083977c19c92f0
+Author: Andrej Gelenberg <andrej.gelenberg@udo.edu>
+Date:   Tue Jan 12 11:22:16 2010 +0100
+
+    Implement XSetDeviceMode request handler
+    
+    Implement XSetDeviceMode request handler for evdev.
+    Devices with absolute axes can be switched in relative
+    mode or absolute mode. Devices with relative axes
+    can be switched only in relative mode. Other devices
+    return BadMatch, cause they have no valuators and
+    don't report motion events.
+    
+    New option "Mode" force devices with absolute axes
+    to work in relative or absolute mode.
+    
+    Need xinputproto.
+    
+    Signed-off-by: Andrej Gelenberg <andrej.gelenberg@udo.edu>
+
+commit 0b5844ce677a99110730ac885fc990c4b8f4bfa9
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Jan 15 15:10:55 2010 -0800
+
+    Update Sun license notices to current X.Org standard form
+    
+    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
+
+commit d6beb16be26df65cd65eaeb146fde0d355521535
+Author: Dima Kogan <dkogan@cds.caltech.edu>
+Date:   Sat Dec 5 02:05:19 2009 -0800
+
+    allow wheel emulation to work with absolute-position devices
+    
+    Signed-off-by: Dima Kogan <dkogan@cds.caltech.edu>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 2f5a0fb6988809a91c4e6821aaed46ba27c9855c
+Author: Dima Kogan <dkogan@cds.caltech.edu>
+Date:   Sat Dec 5 02:08:32 2009 -0800
+
+    removed unnecessary static declarations
+    
+    Signed-off-by: Dima Kogan <dkogan@cds.caltech.edu>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 1b0df04abe329433658c95debdafdf1714173814
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Dec 1 15:44:39 2009 +1000
+
+    Fix up BTN_TOUCH handling for non-button tablets.
+    
+    BTN_TOOL_* is treated as tool, just like before. BTN_TOUCH on the other hand
+    may need to be treated as a button left press. This again requires a button
+    class.
+    
+    Tested on an HP Touchsmart and a Wacom tablet.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 2ca24a16f08095f35d5610f16e202c525b3075e9
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Dec 1 14:16:10 2009 +1000
+
+    Only init the calibration property for absolute devices.
+    
+    Relative devices can't be calibrated anyway so why bother.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 7b285a802b8ccddd1edcf40ab345c4a96bcdf43c
+Author: David Woodhouse <dwmw2@infradead.org>
+Date:   Tue Dec 1 00:14:54 2009 +0000
+
+    Report initial calibration parameters.
+    
+    Where an initial calibration is provided through the Calibration option
+    to the driver, it wasn't being exposed in the 'Evdev Axis Calibration'
+    property. Remedy that...
+    
+    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
+    Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit f187badb71554a73bf9ca30ce75c9d166e688f03
+Author: David Woodhouse <dwmw2@infradead.org>
+Date:   Tue Dec 1 00:12:36 2009 +0000
+
+    Swap axes before applying touch screen calibration.
+    
+    When the SwapAxes option is set, the X and Y axes in calibration should
+    be labelled as the user perceives them -- not as the kernel sends them.
+    
+    Currently, we apply the X-axis calibration to the X-axis of the input,
+    and then do the axis swapping so we've actually applied the X-axis
+    calibration to what the user sees as the Y-axis.
+    
+    This patch changes the order of the operations, so that the axes are
+    swapped before the calibration is applied.
+    
+    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
+    Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 0e9d75ba68d648f38ea5850f910867c9fc908d07
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Nov 27 14:29:52 2009 +1000
+
+    Fix a comment, EV_CNT is available since 2.6.24
+    
+    Introduced in the kernel as 2.6.23-6147-g7b19ada.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 3a6d27b83dbc69e42f289d7249bfa92328b69676
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Nov 23 09:25:05 2009 -0500
+
+    Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
+    
+    Now that the INSTALL file is generated.
+    Allows running make maintainer-clean.
+
+commit 886e303af1434d5af8db6938e873baf399261105
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Oct 28 14:41:40 2009 -0400
+
+    INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+    
+    Automake 'foreign' option is specified in configure.ac.
+    Remove from Makefile.am
+
+commit 3d23ef4888a75b42a95e117db0811e98693f8d09
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Wed Oct 28 14:09:09 2009 -0400
+
+    INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
+    
+    Add missing INSTALL file. Use standard GNU file on building tarball
+    README may have been updated
+    Remove AUTHORS file as it is empty and no content available yet.
+    Remove NEWS file as it is empty and no content available yet.
+
+commit c0473e4921f3c3beec59abefb63180cba4d168df
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Mon Oct 26 12:54:20 2009 -0400
+
+    Several driver modules do not have a ChangeLog target in Makefile.am #23814
+    
+    The git generated ChangeLog replaces the hand written one.
+    Update configure.ac to xorg-macros level 1.3.
+    Use XORG_DEFAULT_OPTIONS which replaces four XORG_* macros
+    Update Makefile.am to add ChangeLog target if missing
+    Remove ChangeLog from EXTRA_DIST or *CLEAN variables
+    This is a pre-req for the INSTALL_CMD
+
+commit afc9e917656508fc3277b7d39e5ab436cf0542f4
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Thu Oct 22 12:34:16 2009 -0400
+
+    .gitignore: use common defaults with custom section # 24239
+    
+    Using common defaults will reduce errors and maintenance.
+    Only the very small or inexistent custom section need periodic maintenance
+    when the structure of the component changes. Do not edit defaults.
+
+commit c1f16a4f59a584ab4546c2f16e20b06703042057
+Author: Bartosz Brachaczek <b.brachaczek@gmail.com>
+Date:   Fri Nov 13 00:18:00 2009 +1000
+
+    Set all valuators for relative motion events (#24737)
+    
+    We should process all the deltas reported by a relative motion device,
+    otherwise some devices such as A4Tech X-750F or similar may trigger a
+    situation when the `v` array contains random values (it isn't
+    initialized anywhere) and later we process them and in effect the mouse
+    cursor "jumps" on the screen.
+    I'm not sure why, but we also must be sure that the `first` and `last`
+    variables reflect the axis map, otherwise the mouse cursor "jumps" on
+    the screen when clicking mouse buttons in some rare cases reported by
+    Bartek Iwaniec on Bugzilla. That's why a simple initialization of the
+    `v` array with zeros isn't sufficient.
+    
+    X.Org Bug 24737 <http://bugs.freedesktop.org/show_bug.cgi?id=24737>
+    
+    Signed-off-by: Bartosz Brachaczek <b.brachaczek@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit a0f7f34dc5effc5822c618bfbf3a0872669c30ad
+Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Date:   Mon Nov 2 23:11:55 2009 -0800
+
+    Relax checks when reopening devices
+    
+    When checking whether we are dealing with the same device as before
+    when we try to reopen it evdev should not require exact match of
+    entire keymap. Users should be allowed to adjust keymaps to better
+    match their hardware even after X starts. However we don't expect
+    changes in [BTN_MISC, KEY_OK) range since these codes are reserved for
+    mice, joysticks, tablets and so forth, so we will limit the check to
+    this range.
+    
+    The same goes for absinfo - limits can change and it should not result
+    in device being disabled.
+    
+    Also check the length of the data returned by ioctl and don't try to
+    compare more than we were given.
+    
+    [peter: moved the key comparison below the led+abs comparison]
+    
+    Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 11669d82790fd7c94c44c0d487d3fa5e203528e9
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Nov 2 13:57:18 2009 +1000
+
+    Fix drag-lock property handler for multiple draglock buttons.
+    
+    Parsing of the values was wrong. Given an input of 1 2 3 4, button 1 sets
+    the lock for button 2 and button 3 sets the lock for button 4.
+    
+    This also means we need to return BadMatch if the property isn't a multiple
+    of 2.
+    
+    Red Hat Bug 524428 <https://bugzilla.redhat.com/show_bug.cgi?id=524428>
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9cbffda91009001ab6aab84efd2ffb4e35561958
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Oct 22 15:13:02 2009 +1000
+
+    Forward keycodes > 255
+    
+    The server doesn't handle them yet but eventually it should learn.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 59056e656c6475816ab45b2798bd4d4466482f6a
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Oct 13 14:51:49 2009 +1000
+
+    Remove the reopen timer logic.
+    
+    This logic was needed in older kernels that sometimes gave error messages
+    after coming back from resume (2.6.27 release kernels). I haven't seen any
+    log files that needed this reopen timer in a long time, suggesting that need
+    for it is gone.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit aa6399fdb9ec970e205b1efb336338ac870d2bcf
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Oct 19 11:40:24 2009 +1000
+
+    evdev 2.3.0
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 1d86f5dec16beaf9391f320d7702cc59e9486bf4
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Oct 15 11:13:47 2009 +1000
+
+    Convert IgnoreAbsolute/RelativeAxes options into trinary state.
+    
+    The Xen Virtual Pointer device exports both absolute and relative axes from
+    the kernel device. Which coordinates are used is a run-time decision and
+    depends on the host-specific configuration.
+    0a3657d2ee62f4086e9687218cb33835ba61a0b3 broke these devices, and they are
+    now unusable out-of-the-box as there is no configuration to cover them.
+    
+    This patch converts the IgnoreAbsoluteAxes and the IgnoreRelativeAxes
+    configuration options into a trinary state.
+    1. If unset, configure the device as normal by trying to guess the right
+       axis setup.
+    2. If set to true, ignore the specific axis type completely (except for
+       wheel events).
+    3. If set to false, explicitly 'unignore' the axis type, alwas configuring
+       it if it is present on the device. This setting introduces seemingly
+       buggy behaviour (see Bug 21832)
+    
+    1. and 2. replicate the current driver behaviour.
+    The result of 3. is that is that if a device has absolute axes and the
+    options set to false, both axes will be initialized (absolute last to get
+    clipping right). This requires axis labelling priorty to switch from
+    relative first to absolute first.
+    
+    Relative events are forwarded into the server through the absolute axes,
+    the server scales this into the device absolute range and everyone is happy.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit fbd86e2530f3f69f397d3bae9ad87cf8e2d14221
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Oct 15 10:52:27 2009 +1000
+
+    Fix copy/paste typo in comment.
+
+commit 9ea1f9a6954c8dceee17076f10ff0f82f042de88
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Oct 13 10:49:46 2009 +1000
+
+    Fix typo, use uppercase like the other messages
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 57b54ee3995f2f678ef359e7663cad517a8b2433
+Author: Oliver McFadden <oliver.mcfadden@nokia.com>
+Date:   Mon Oct 12 16:32:51 2009 +0300
+
+    evdev: Support the "Calibration" string option.
+    
+    Originally based on a patch from Daniel Stone, this commit allows for
+    the calibration factors to be set either from Xorg.conf or via HAL.
+    
+    Previously the only way was via the properties interface.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit f2dc0681febd297d95dae7c9e3ae19b771af8420
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Oct 6 19:09:33 2009 +1000
+
+    Finalize the middle button emulation when a read error occurs (#23048)
+    
+    If a read error occurs, remove the block and wakeup handlers for middle
+    mouse button emulation. Otherwise, they'll still be around after the device
+    has been reopened and overwritten with the new ones created by EvdevOn. Once
+    this happened, future removal of the device can lead to a server crash.
+    
+    X.Org Bug 23048 <http://bugs.freedesktop.org/show_bug.cgi?id=23048>
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 3fa49dfcab9081787840ed6bb9451cb73f65e248
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Oct 8 14:26:41 2009 +1000
+
+    evdev 2.2.99.2
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 941391ca34a7537542f0bb894fc0f02e200165b4
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Sep 30 12:05:17 2009 +1000
+
+    Add explicit options to ignore relative or absolute axes.
+    
+    The X server cannot deal with devices that have both relative and absolute
+    axes. Evdev tries to guess wich axes to ignore given the device type and
+    disables absolute axes for mice and relative axes for tablets, touchscreens
+    and touchpad. This guess is sometimes wrong and causes exitus felis
+    domesticae parvulae.
+    
+    Two new configuration options are provided to explicitly allow ignoring an
+    axis. Mouse wheel axes are exempt and will work even if relative axes are
+    ignored.  No property, this option must be set in the configuration.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Acked-by: Daniel Stone <daniel@fooishbar.org>
+
+commit 2144f7d83426136cc1a9de2fafb302683645c6da
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Sep 30 11:49:21 2009 +1000
+
+    Remove unused has_xy.
+    
+    has_xy is only ever set, but not used for anything else.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 61b4e88e01f32e976f85e7970a7f5b21fcd84f97
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Sep 21 16:56:28 2009 +1000
+
+    emuWheel: fix signed/unsigned screwup
+    
+    This patch fixes wheel emulation on buttons other than 0.
+    
+    Reported-by: Andy Neitzke
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9ee70943ec304b08b8e4651c512a8e65fa13cc9c
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Sep 11 09:57:22 2009 +1000
+
+    Require xorg-macros 1.3 and XORG_DEFAULT_OPTIONS
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 415b6ffa958e3103eeb52af4ccd881497169eed4
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Aug 20 11:02:31 2009 +1000
+
+    Only take the driver-internal button mapping to count buttons (#23405)
+    
+    Regression:
+        If a user has multiple buttons mapped to the same button number, the
+        number of buttons counted is set to a wrong value.  e.g. a button
+        mapping of 1 1 1 for a mouse with three buttons would only initialize 1
+        button to the X server.
+    
+        In the future, the user cannot change this button mapping as the server
+        only knows about one button.
+    
+    The user-supplied button map (option ButtonMapping) shouldn't matter when
+    counting the buttons. Only the driver-internal mapping (BTN_0 -> button 1,
+    etc.) matters.
+    
+    X.Org Bug 23405 <http://bugs.freedesktop.org/show_bug.cgi?id=23405>
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit f4ba2bd785b25fd522967abd7775925d5fded70f
+Author: Dima Kogan <dkogan@secretsauce.net>
+Date:   Sun Aug 16 23:11:50 2009 -0700
+
+    Allow 0 as wheel emulation button for unconditional scrolling (#20529)
+    
+    If wheel emulation is on and the emulation button is 0, then any x/y motion
+    of the device is converted into wheel events. The devices becomes a
+    scrolling-only device.
+    
+    Signed-off-by: Dima Kogan <dkogan@cds.caltech.edu>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 2e5f68754fd5bc4e6b7fa5b95bdd30e2bb4e57fb
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Aug 17 09:41:11 2009 +1000
+
+    Restrict wheel emulation to a single axis at a time.
+    
+    Wheel emulation works for both horizontal and vertical axes. Thus, if a
+    device doesn't move in perfect straight line, scroll events build up on the
+    respective other axis.
+    
+    In some clients, scroll wheel events have specific meanings other than
+    scrolling (e.g. mplayer). In these clients, erroneous scrolling events come
+    at a high cost.
+    
+    Thus, if a scroll wheel event is generated for one axis, reset the inertia
+    of the other axis to 0, avoiding the buildup of these erroneous scrolling
+    events.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 8fdb2abb6fe0426cbbfeead2c187092a56792557
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Aug 14 12:59:27 2009 +1000
+
+    man: fix documentation for EVDEV_PROP_WHEEL_BUTTON
+    
+    0 doesn't disable it, it's still treated like a button number. copy/paste
+    error.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit ca0fb396f1a4b87be9f8aa7ad066e0b469c9075d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Aug 14 11:00:12 2009 +1000
+
+    evdev 2.2.99.1
+
+commit 7967677789e3ee24733b3514e1ae7a8e12bbc2b5
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Aug 14 09:05:40 2009 +1000
+
+    Treat tablets (BTN_TOOL_PEN devices) differently from touchpads.
+    
+    The previous checks for BTN_TOOL_FINGER and BTN_TOUCH reported false
+    positives for touchpads for most popular tablets.
+    As a result, their events were converted to relative events.
+    
+    Add a new flag EVDEV_TABLET pending presence of BTN_TOOL_PEN and ignore the
+    touchpad special casing to report the events as-is.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 36064dca9097df896b4b1b49c9c68775f1728846
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Aug 13 10:27:16 2009 +1000
+
+    Add EvdevPostButtonEvent API to immediately post a button event (#23269)
+    
+    The wheel emulation code needs this API. When the timer expires, the event
+    must be posted immediately, not enqueued onto the internal event queue.
+    Otherwise, the emulated middle button press is enqueued only and no event is
+    sent until the next physical event (and its EV_SYN) arrives.
+    
+    Since the timer is triggered outside of the SIGIO and SIGIO is blocked
+    during this period anyway, we could also just enqueue the event and flush by
+    simulating an EV_SYN. It's easier this way though.
+    
+    X.Org Bug 23269 <http://bugs.freedesktop.org/show_bug.cgi?id=23269>
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Acked-by: Oliver McFadden <oliver.mcfadden@nokia.com>
+
+commit 8bf93709cbcf9f041cd177e929ff46adce8a6b79
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Aug 13 10:16:18 2009 +1000
+
+    Rename parts of the Post API to a Queue API.
+    
+    Button and key events aren't posted from EvdevPost*Event, they are simply
+    enqueued onto the evdev-internal event queue until the next EV_SYN arrives.
+    Rename those interfaces from EvdevPost* to EvdevQueue* and leave only those
+    that actually post to the server with a matching "*Post*" name.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Acked-by: Oliver McFadden <oliver.mcfadden@nokia.com>
+
+commit 37373a223b2aeef7041c9c0bb99be613789a3125
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Aug 13 10:26:33 2009 +1000
+
+    comment typo fix
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit d764dded18c47cec009babc075f2324cba1781ce
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Aug 5 18:57:30 2009 +1000
+
+    Skip check for EVDEV_RELATIVE_EVENTS for wheel events.
+    
+    This patch fixes a regression introduced with 1f641d75e.
+    Wheel axis events are posted as button clicks, a device may have no relative
+    axes but it does need to post these button clicks.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit f352598e45be86f9e24d9dba88c657f03f3b168e
+Author: Michael Witten <mfwitten@gmail.com>
+Date:   Tue Aug 4 03:11:49 2009 -0500
+
+    evdev.c: Fix/improve discrimination of rel/abs axes
+    
+    The relevant comment from evdev.c:
+    
+    We don't allow relative and absolute axes on the same device. The
+    reason is that some devices (MS Optical Desktop 2000) register both
+    rel and abs axes for x/y.
+    
+    The abs axes register min/max; this min/max then also applies to the
+    relative device (the mouse) and caps it at 0..255 for both axes.
+    So, unless you have a small screen, you won't be enjoying it much;
+    consequently, absolute axes are generally ignored.
+    
+    However, currenly only a device with absolute axes can be registered
+    as a touch{pad,screen}. Thus, given such a device, absolute axes are
+    used and relative axes are ignored.
+    
+    The code for initializing abs/rel axes has been abstracted out into
+    3 functions, so that initialization in EvdevInit(device) is as easy
+    as:
+    
+        if (pEvdev->flags & (EVDEV_TOUCHPAD | EVDEV_TOUCHSCREEN))
+            EvdevInitTouchDevice(device, pEvdev);
+        else if (pEvdev->flags & EVDEV_RELATIVE_EVENTS)
+            EvdevInitRelClass(device, pEvdev);
+        else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS)
+            EvdevInitAbsClass(device, pEvdev);
+    
+    Signed-off-by: Michael Witten <mfwitten@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 69d6ff3e01263ce2d52ed18b08f054bf3fdb923c
+Author: Oliver McFadden <oliver.mcfadden@nokia.com>
+Date:   Sun Aug 2 12:03:04 2009 +0300
+
+    evdev: Use the EvdevPost...Event() functions in the emulation code.
+    
+    This is similar to commit 1f641d75edba7394201c1c53938215bae696791b.
+    
+    It provides the same functionality of queuing the (in this case
+    emulated) events and waiting until an EV_SYN synchronization event is
+    received before posting them to the server.
+    
+    This preserves the order of events (both real and emulated) and ensures
+    that MotionNotify events will always be posted first. It also unifies
+    the event posting into a few small functions which improves
+    maintainability.
+    
+    From this point on, you should never use the xf86Post...Event()
+    functions in new code, but rather the EvdevPost...Event() versions.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 6f4634111a83808bc52e7e53733cf2d3bab0cccd
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 30 09:27:27 2009 +1000
+
+    Evdev doesn't require inputproto.
+    
+    None of the inputproto headers seem to be included anywhere.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 1f641d75edba7394201c1c53938215bae696791b
+Author: Oliver McFadden <oliver.mcfadden@nokia.com>
+Date:   Thu Jul 23 13:19:49 2009 +0300
+
+    evdev: Only send the events at synchronization time.
+    
+    Instead of just posting the button/key press/release events to the
+    server as soon as they arrive, add them to an internal queue and post
+    them once we receive an EV_SYN synchronization event.
+    
+    The motion events are always sent first, followed by the queued events.
+    There will be one motion event and possibly many queued button/key
+    events posted every EV_SYN event.
+    
+    Note that the size of the event queue (EVDEV_MAXQUEUE) is arbitrary and
+    you may change it. If we receive more events than the queue can handle,
+    those events are dropped and a warning message printed.
+    
+    Tested on my Lenovo T400 using evdev for all input devices; keyboard,
+    touchpad, and trackpoint.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 2994825665790dc8e35b2944e0d411f3cc9f76fd
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Jul 20 14:52:34 2009 +1000
+
+    Don't register middle mouse button emulation handlers for keyboards.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9bfd9e8a3683f14860149ae9f842e88828cc0960
+Author: Oliver McFadden <oliver.mcfadden@nokia.com>
+Date:   Thu Jul 16 18:25:37 2009 +0300
+
+    Coverity Prevent: NO_EFFECT in EvdevWheelEmuSetProperty:
+    
+    Event unsigned_compare: Comparing unsigned less than zero is never true. "pEvdev->emulateWheel.timeout < 0UL"
+    342                    if (pEvdev->emulateWheel.timeout < 0)
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit dcca28a59ce0a2f8a06c559eed493ca43afc20cb
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Apr 29 18:29:58 2009 +1000
+
+    Count REL_DIAL as a scrollwheel during EvdevProbe (#21457)
+    
+    The Griffin Powermate only has a single axis (REL_DIAL). This axis is
+    posted as horizontal scroll wheel, so we need to ensure the scroll wheel
+    setup (including ensuring that enough buttons are available) is triggered
+    accordingly.
+    
+    X.Org Bug 21457 <http://bugs.freedesktop.org/show_bug.cgi?id=21457>
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit db8b1ca5cffbc48f7d9c5c166489c714ac92ea86
+Author: Asbjørn Sannes <ace@sannes.org>
+Date:   Wed Jul 1 09:51:12 2009 +0200
+
+    evdev: Fix spelling of property in man page to match source code. #22571
+    
+    Signed-off-by: Asbj�rn Sannes <ace@sannes.org>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 8cc0d0f285261b0f26d22b5b4eca9ccbd1beeb93
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Jun 26 09:59:04 2009 +1000
+
+    Fix absolute axis labelling - mapping must be initialized before the labels.
+    
+    88eedea281a710008a82f1e6af4bdffd19477f46 added axis labelling to the
+    valuator initialization. This requires the axis mapping to be established
+    before the absolute axis labels are initialized.
+    
+    88eedea did this for relative axes, but missed out on the absolute ones. As
+    a result, all abs. labels were initialized to "None".
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit aa1609285dfa51570f74671a9f4240bccc1516c2
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Jun 26 09:42:36 2009 +1000
+
+    Message "found absolute touchpad" also applies to tablets - fix.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b07ab6ea97b779b26e7ae8326528c262cc9907a1
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Jun 26 09:37:29 2009 +1000
+
+    If a device fails to initialize relative axes, init the abs. axes instead.
+    
+    Some devices have relative axes that don't count (scroll wheels). In this
+    case, don't claim we've initialized relative axes, continue with the
+    absolute axes instead.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 7bc48c666d702e649dc529b5d928b6a8549514c3
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Jun 23 15:43:16 2009 +1000
+
+    Fix wrong axis label index causing OOB reads/writes.
+    
+    The atoms array is filled with each axis atom in mapping order (i.e. after
+    the driver mapping has been applied). 'axis' OTOH is from 0 to ABS_MAX.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 880ad1e19afd83ac115948b67d4049e16cb12df0
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Jun 23 14:48:17 2009 +1000
+
+    Initialize the axis labels to 0, not "misc".
+    
+    If we don't know what an axis label is, then don't initialize it. None is a
+    valid label.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 6ab23e4519ed4ce07b745c573ddf544a2a1ee1b2
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 18 16:15:16 2009 +1000
+
+    Add missing checks for ABI_XINPUT_VERSION 7.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 88eedea281a710008a82f1e6af4bdffd19477f46
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 18 15:33:33 2009 +1000
+
+    Cope with ABI_XINPUT_VERSION 7 - requires button + axes labels.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9a5a4fed3acae87c89694a9ef8bf905ca0d6a6dd
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jun 18 15:15:57 2009 +1000
+
+    Split axes and button labels into separate function.
+    
+    We'll re-use this bit very soon.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 0a3657d2ee62f4086e9687218cb33835ba61a0b3
+Author: Derek Upham <sand@blarg.net>
+Date:   Thu May 21 00:15:28 2009 -0700
+
+    evdev: Prevent driver from processing motion events that it has not configured. #21832
+    
+    The current implementation initializes itself to support relative
+    motion events, or absolute motion events, or neither.  But the
+    event-handling code attempts to process all events, no matter what the
+    initialization was.  This patch reproduces the flag tests found during
+    init, to skip events that the driver doesn't support.
+    
+    Signed-off-by: Derek Upham <sand@blarg.net>
+    Signed-off-by: Julien Cristau <jcristau@debian.org>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit dc2191285e799be891787e1f64d10c1cba271240
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu May 21 13:30:10 2009 +1000
+
+    Deal with BTN_3 to BTN_9 buttons.
+    
+    These buttons were previously mapped to 0, i.e. inactive. This patch
+    slightly improves things in that the buttons are now mapped to 8+.
+    
+    Devices that have both BTN_3 and BTN_SIDE (or a similar pair in that
+    sequence) have both mapped to the same button number though.
+    Devices that have BTN_LEFT, BTN_0, BTN_3 and BTN_SIDE have the last three
+    mapped to 8 (and their followers have double-mappings too). We'll fix that
+    once we actually see devices affected by this.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 255b9f6bbf374a315750019c6fadc5f82fb7d41d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu May 21 10:23:37 2009 +1000
+
+    Only initialize the number of buttons we actually have.
+    
+    This takes into account driver-configured button mappings, i.e. if device
+    with one button has this button mapped to 25 through the ButtonMapping
+    option, the X server will think the device has result 25 buttons.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit aa117d49a5139bcc453e6ab022b67347464a8acd
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu May 21 09:51:57 2009 +1000
+
+    Rename pEvdev->buttons to pEvdev->num_buttons for clarity.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b358f1eb3a4ef8fdee099114d6c70d6ea06eba95
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed May 20 11:57:01 2009 +1000
+
+    Ensure enough buttons are advertised to pass the button mapping.
+    
+    Some buttons are mapped to higher button numbers. For example, BTN_0 is
+    posted as button 8 if BTN_LEFT is present. On top of that, the
+    driver-specific button mapping may map the button to something else again.
+    We need to take these mappings into account when counting the number of
+    buttons on the device.
+    
+    Example: A device with BTN_LEFT and BTN_0 and a mapping from 1 -> 7 and 8 ->
+    2.
+    
+    BTN_LEFT is mapped to 1. 1 is mapped to 7. num_buttons is 7.
+    BTN_0 is mapped to 8. 8 is mapped to 2. num_buttons remains 7.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 33cc112ca1af377a85cfeb05dfb72f07d3850a95
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed May 20 11:47:37 2009 +1000
+
+    Up the number of button labels atoms to EVDEV_MAXBUTTONS.
+    
+    Button labels would smash memory if the device had less than 4 buttons and
+    did not advertise a wheel event. In this case the hard-coded wheel button
+    labels would write past the atoms[] boundary.
+    
+    Potential memory smash if a device had a BTN_LEFT and BTN_0, since the
+    latter would map to 8, regardless of the the number of actual buttons
+    (same with BTN_MIDDLE and BTN_1 or BTN_RIGHT and BTN_2).
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 3c43d880f13725a04fcd7c0c8d5978a36208e373
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed May 20 11:42:35 2009 +1000
+
+    Only label axes and buttons if the device has axes or buttons.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 54628989356793828fcbb5f62a091b962c7da4f9
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed May 13 12:51:52 2009 +1000
+
+    Use xf86DisableDevice instead of the DIX' DisableDevice.
+    
+    DisableDevice has changed API in xi2, xf86DisableDevice hasn't. So let's use
+    this one so we can have one version for master and xi2.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9243d338d1de7df8afb1e254590cd4bf84888c7e
+Author: Dan Nicholson <dbn.lists@gmail.com>
+Date:   Sun May 10 08:29:21 2009 -0700
+
+    Fix copy-paste error when probing type name
+    
+    A minor copy and paste error was introduced in 71e9a69e leaving an "if"
+    where an "else if" should be. Without this, any device configured as
+    XI_TOUCHPAD or XI_TABLET will end up having the type_name reset to
+    either XI_TOUCHSCREEN or XI_MOUSE.
+    
+    Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 71e9a69ed68257e5ded26c062a9797de571bb880
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Apr 29 18:03:18 2009 +1000
+
+    Revamp the whole "has_axes" definition.
+    
+    Since we can now deal with multiple axes, etc. we might as well print it
+    properly.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 220e2dfb8f6aa08bd5f59e81c6883c057b945721
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Apr 16 13:23:50 2009 +1000
+
+    Print read errors as X_NONE to avoid mallocs in the server.
+    
+    Messages of type X_NONE are just passed down to the log files, everything else
+    gets the (EE) or (II) prefixed. Since this mallocs, we can't use it in the
+    signal handler.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit ddc126637404cb3d9356b7698779dcd8849f8718
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Apr 16 12:01:03 2009 +1000
+
+    Pre-allocate the reopen timer so we don't allocate during sigio handling.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 98ecb5233bb3b899bd696a90d2733c6a345676dd
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Apr 6 10:22:25 2009 +1000
+
+    Trigger read error handling if len is <= 0.
+    
+    Red Hat Bug 494245 <https://bugzilla.redhat.com/show_bug.cgi?id=494245>
+    
+    Reported-by: David Woodhouse <dwmw2@infradead.org>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 92ca3dc2e759759545c0e0adea4277b3bddb05e5
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Mar 26 13:40:07 2009 +1000
+
+    Fix wrong reference to axis and button label atom list.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 3fa28c8acd3aad054f9c74e94c1411654d709dca
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Mar 26 10:11:26 2009 +1000
+
+    Remove test/ directory.
+    
+    This shouldn't really be part of the driver source, it's better to just have
+    it as a separate repository. Code has moved to
+    git://people.freedesktop.org/~whot/testdevices.git
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit d9809d7edd2be714a15115b990286554e2979fb6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Mar 17 14:08:29 2009 +1000
+
+    Fix jumpy touchpads by updating old_vals only when reported by the device.
+    
+    Remember whether ABS_X or ABS_Y were reported before the SYN event and only
+    update the old_vals[0, 1] if we got data for them.
+    Touchpads that reported pressure data before x/y would otherwise update
+    old_x/y with bogus values, leading to jumps when the first x/y coordinates
+    were actually reported.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b11439a1763b5f210460b492dd4f47e973f90a3a
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Mar 17 13:25:58 2009 +1000
+
+    If we have a touchpad, print so, don't claim we're configuring a tablet.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 740dc202f735106532dce581deabe2b95c52759f
+Author: Jeremy Jay <dinkumator@gmail.com>
+Date:   Mon Mar 16 23:19:54 2009 -0400
+
+    make sure to clear all axis_map entries
+    
+    don't use uninitialized axis_map entries, ie axis_map[ABS_PRESSURE]
+    
+    Signed-off-by: Jeremy Jay <dinkumator@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 7ac0c4456dc0846f7e09f334a26f9536e20065df
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Mar 17 08:02:00 2009 +1000
+
+    Assume touchscreen/touchpad if we have _either_ ABS_PRESSURE or BTN_TOUCH
+    
+    Touchpads have pressure or touch and also BTN_TOOL_FINGER.
+    Touchscreens have either pressure or touch, but no finger.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit b4f6ab126dfc897759559aae7ae32fbc0efe24d8
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Mar 13 13:40:16 2009 +1000
+
+    Move keymap/modifier initialization behind the ABI < 5 ifdefs.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit a3ea979c2b70d166d62422b4ba450ce2910389c3
+Author: Jeremy Jay <dinkumator@gmail.com>
+Date:   Mon Mar 16 08:36:53 2009 +1000
+
+    Set "rel" when converting absolute touchpad coordinates to relative (#20661)
+    
+    We unset "abs" and convert to relative, but never set "rel" so the events
+    don't get posted. This bit got broken in 43dd2a959243877.
+    
+    X.Org Bug 20661 <http://bugs.freedesktop.org/show_bug.cgi?id=20661>
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit a7fb654a68a26ad5f019a902312c6b94dbe9c3ea
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Mar 10 15:17:53 2009 +1000
+
+    Restore repeat-filtering for server 1.5 and earlier.
+    
+    Letting the server deal with key repeats is fine if we have server 1.6. For
+    earlier servers, we need to pass on the repeat events (except for modifier
+    keys).
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Tested-by: Marty Jack <martyj19@comcast.net>
+
+commit 3f06825a446e317485c2e2d1880c1886684d8742
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Mar 9 09:26:51 2009 +1000
+
+    Bump to 2.2.99.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 31853c39bfae7bb1035485407fd245cd11337d4f
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Mar 9 09:29:48 2009 +1000
+
+    Define MAX_VALUATORS if it's missing to allow for builds against 1.5.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 2c49e21a815632fc1addd04dde96592237757a2e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Mar 9 09:05:10 2009 +1000
+
+    Check button label before fetching the Atom from the server.  (#20524)
+    
+    The server doesn't like NULL names, so don't call XIGetKnownProperty for
+    labels that don't exist.
+    
+    X.Org Bug 20524 <http://bugs.freedesktop.org/show_bug.cgi?id=20524>
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Tested-by: Peter Henriksson
+
+commit 4361b3efa0da5e85da7f0506c81dba31e59dc897
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Mar 6 08:13:36 2009 +1000
+
+    Fix duplicate wheel button up mapping.
+    
+    Reported by Simon Thum.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Simon Thum <simon.thum@gmx.de>
+
+commit 281a7b4b88015c768639b7ae960b62f3539f012b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Mar 2 16:27:47 2009 +1000
+
+    evdev 2.1.99.1
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 051cb8b528f6eddddccee44842bcb2152ed0e418
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Feb 26 12:14:20 2009 +1000
+
+    Add support for button labelling.
+    
+    Buttons 4/5 and 6/7 are hardcoded for wheel buttons.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 1abcc881715327614e248e9047c5fbd29a945c03
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Feb 26 10:48:06 2009 +1000
+
+    Rename prop_label to prop_axis_label.
+
+commit c89bbf80be65eb9d0d20871761d22c6d6d76708b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Feb 26 12:14:03 2009 +1000
+
+    Don't double-assign the UKNOWN axis label.
+    
+    All labels default to unknown anyway.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 178435832f5f6988e58fddc4ffe82ddc032d9dce
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Feb 26 12:09:33 2009 +1000
+
+    If scrollwheels are found, bump the button number by 4 (or up to 7).
+    
+    Scrollwheel data is always posted as buttons, so we need to advertise at least
+    enough buttons to accommodate for 6/7 (horizontal wheel).
+    
+    Note that this may mean that if you have a device that has scroll wheels and
+    axes, but no buttons, it may be interpreted as a mouse.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit c9cab83bac32275f6851d2616bb749b3b2621ed6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Feb 24 11:32:40 2009 +1000
+
+    Ignore REL_WHEEL, REL_HWHEEL and REL_DIAL during axis initialisation.
+    
+    We don't post the events for them anyway, so lets ignore them completely.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 43dd2a959243877c1628a08b4fc6c07c9ae6bac0
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Feb 24 10:36:41 2009 +1000
+
+    Pass on all relative events, not just x/y.
+    
+    9620fe776 added generic axes support for relativ values, but values from such
+    axes didn't get passed on to the server. Fix this.
+    
+    Note that wheel events are not posted as motion events.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 7977947e0df6ea6379dab76805b06be6bdd71947
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Tue Feb 24 10:08:22 2009 +1000
+
+    Reduce the number of read calls in ReadInput.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 11a56d4a176a2c5b2f8794147d4bafd88477b80b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Feb 24 09:39:01 2009 +1000
+
+    Split ReadInput into ReadInput and ProcessEvent.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 7b0f613c7f1462fc36f1e13968d96e8b8a559be6
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Tue Feb 24 09:34:26 2009 +1000
+
+    Move relative motion and other magic up to EV_SYN processing.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Adam Jackson <ajax@redhat.com>
+
+commit 75af278861dcd96124544d3c2889028578708317
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Mon Feb 23 16:01:14 2009 -0500
+
+    Open with O_NONBLOCK, and simplify EvdevReadInput to match.
+    
+    xf86WaitForInput() would call select() with zero timeout to discover if
+    more input was ready.  But we know that's always true at least once,
+    since we're only ever called from the sigio handler (if silken is
+    active) or from the main loop (if it's not and we selected readable).
+    With nonblocking IO we can just spin around until we hit EAGAIN, which
+    gets us down to n+1 syscalls per event instead of 2n.
+
+commit 4fd9cd2ea81607c17eb39baaad24f09dd55995f2
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Feb 19 10:02:49 2009 +1000
+
+    Revert "Remove useless include directive."
+    
+    Necessary for builds against 1.6, but let's at least get rid of XKB defines.
+    
+    This reverts commit aa5dfa1d6ae374479d39f1394b85660e6b6bb881.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 12c287df894c88a1b2badf105ef625c7c67f334d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Feb 18 09:30:17 2009 +1000
+
+    Label axes conditional on actual support.
+    
+    Server 1.6 has device properties, but not axis labels.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9f1b9aa6eb81087b3df12184eafb104c0e745f41
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Feb 18 09:04:12 2009 +1000
+
+    Accommodate for holes in the ABS label defines.
+    
+    abs_labels[] has to be aligned with the defines in linux/input.h, but the
+    latter does not have continuous range. Pad the holes with
+    AXIS_LABEL_PROP_ABS_MISC.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit acb1d557e216d7fa58ef8dbf3182e6604888ae2a
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Feb 17 15:08:03 2009 +1000
+
+    Add support for arbitrary relative axis labels.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 6a1f8f463d28c263a73b81b92d9d52a6cd3873cb
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Feb 17 14:54:49 2009 +1000
+
+    Remove superfluous (and duplicate) call to xf86MotionHistoryAllocate.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 9620fe7765b340213a552b5656d9d10bbbefd4cb
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Feb 17 14:53:51 2009 +1000
+
+    Add generic axis support for relative axes.
+    
+    Just query the kernel what axes we actually have, rather than hard-coding x/y.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit a1714cac5242e5f8320ed7212efca481351355a2
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Feb 17 14:42:19 2009 +1000
+
+    Add dynamic axis labelling for absolute devices.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 5a99ef7ed21ff879b6c55027590733bc7a9c6742
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Feb 16 15:11:20 2009 +1000
+
+    remove duplicate (code > 255) check.
+
+commit 3b22e4703fa712ddb6d14d3a847ecfeac27520b4
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Feb 16 14:48:04 2009 +1000
+
+    man: list the options and properties in alphabetical order.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 0de20a8f1b9f80b33081cea20444a05a745cb95e
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Feb 16 14:40:45 2009 +1000
+
+    man: Fix two minor typos in man page.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 978384ede7b0832fef8a399efbc3050bb2f212f7
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Feb 16 14:07:30 2009 +1000
+
+    Swap axes after scaling, not before.
+    
+    If we swap before scaling, we scale with the wrong coordinate range.
+    
+    Reported by Matt Helsley.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit df7ff12ed230009de895107c40de8f457879d66b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Feb 16 12:00:52 2009 +1000
+
+    CacheCompare before probing the device.
+    
+    Saves a few duplicate ioctls.
+    
+    Suggested by Matt Helsley.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit dd2c89ac93535b833ee79e459410f4679c060774
+Author: Matt Helsley <matt.helsley@gmail.com>
+Date:   Mon Feb 16 11:18:50 2009 +1000
+
+    General axis valuator support.
+    
+    Instead of x/y and pressure, support any absolute axis that is reported on the
+    device. Note that there are still locations that special-case X and Y.
+    
+    Minor modifications by Peter Hutterer.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 4616c79f6cc6d81c1d9d27efa05ffaf51d521d2b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Feb 16 11:15:25 2009 +1000
+
+    Change cached bitmasks from long to unsigned long.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit a31170718d098fd7ce42cf4f6e457a713e39a0c1
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Feb 16 10:48:58 2009 +1000
+
+    Remove unused 'screen' variable from the EvdevRec.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 95099cb0368d76ee139f1442253f26f68d493df9
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Feb 16 10:43:36 2009 +1000
+
+    Log which EVIOCGABS ioctl failed.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit c58bae0b77b9e39ab341af994648ca22867271a2
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Feb 16 12:05:45 2009 +1000
+
+    Remove superfluous motion history allocation.
+    
+    The motion history buffer is allocated during InitValuatorClassDeviceStruct
+    anyway.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 32242871f7001e7e995d501a32f350120bad2fd6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Feb 16 08:51:22 2009 +1000
+
+    Remove duplicate MB emu finalization.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit aa5dfa1d6ae374479d39f1394b85660e6b6bb881
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Feb 13 16:24:36 2009 +1000
+
+    Remove useless include directive.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 2a6c1d7a605e11189e4539db84b1c4da5707dbc6
+Author: Bryce Harrington <bryce@bryceharrington.org>
+Date:   Thu Feb 12 17:52:43 2009 -0800
+
+    Add descriptive messages for device-has-changed errs
+    
+    As can be seen in e.g. bugs 19819 & 20025, it can be unclear what
+    exactly caused a given "Device has changed - disabled" error.  This
+    patch adds some more specific messages to give a better clue on what
+    exactly was seen to have changed.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 0f0743e3cfc2f7d288dfec3fba9bc093cbedf537
+Author: Dan Nicholson <dbn.lists@gmail.com>
+Date:   Mon Feb 2 22:35:20 2009 -0800
+
+    Really fix distcheck
+    
+    distcheck has an annoying feature where it checks that all files install
+    under $prefix. Unfortunately, this conflicts with the desire to install
+    headers to the SDK directory. Workaround by passing --with-sdkdir during
+    distcheck.
+    
+    Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 095766ebb3afafc4906cb29e22d996dbcd773ad8
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Mon Feb 2 19:47:50 2009 -0200
+
+    Janitor: make distcheck, .gitignore.
+    
+    Remove non toplevel .gitignore and .cvsignore files.
+      The "make distcheck correction" for $(sdkdir) probably has a better
+    approach using a "*-hook:" target, or possibly making $sdkdir a
+    configure time option that could be set with DISTCHECK_CONFIGURE_FLAGS.
+
+commit 0dbb88c52b057cfdff6116060060841e4fc4abb5
+Author: Julien Plissonneau Duquene <julien.plissonneau.duquene@savoirfairelinux.com>
+Date:   Mon Feb 2 10:46:52 2009 -0500
+
+    EvdevCacheCompare: ignore changes in current device position
+    
+    Input devices (especially touchscreens) were disabled when switching
+    virtual console back to X because EvdevCacheCompare() thought the device
+    was substituted by another while away from X. Actually only the current
+    position reported by the device changed from what was in the cache. Fixed
+    by ignoring the current position in the comparison.
+    
+    Fixes bug #19819.
+    
+    Signed-off-by: Julien Cristau <jcristau@debian.org>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit c9281567024ef1e94f2da42f0d701ed69728c355
+Author: Peter Breitenlohner <peb@mppmu.mpg.de>
+Date:   Fri Nov 21 21:57:41 2008 +0100
+
+    fix manpage formatting
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 07f40a04df28e9ee6318411beb71eedc7cd6e288
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Feb 2 11:00:30 2009 +1000
+
+    Protect against zero-sized property values. #19882
+    
+    X.Org Bug 19882 <http://bugs.freedesktop.org/show_bug.cgi?id=19882>
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit e260993b6af0c463bd593a3192d2ba4ee6912fc9
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Jan 30 20:18:50 2009 -0800
+
+    Add README with pointers to mailing list, bugzilla & git repos
+
+commit dc72e6d8aecbc60900bb3b72978d63495f3f6954
+Author: Dan Nicholson <dbn.lists@gmail.com>
+Date:   Thu Jan 22 10:15:15 2009 -0800
+
+    Stop hammering XKB defaults
+    
+    With the new InitKeyboardDeviceStruct, we can just pass the RMLVO we
+    want without setting the defaults first.
+    
+    Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
+    Signed-off-by: Daniel Stone <daniel@fooishbar.org>
+
+commit 1906e4d5c112c25c9d7a736d4924d1005267aba7
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jan 22 09:44:15 2009 +1100
+
+    Reshuffle property initialization.
+    
+    We don't need axis calibration, etc. on keyboards, so let's do it
+    conditionally on actually having axes.
+    
+    Reported by Simon Thum.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 3047c25db24becf475b45d13e03a8badd58dcde6
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jan 22 09:19:16 2009 +1100
+
+    Deal with XINPUT ABI 5.
+    
+    Some XKB stuff has been removed, so let's deal with it.
+
+commit c158cf2b64034a49e1c95549603b684e21e7511a
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Wed Jan 21 16:32:27 2009 +1100
+
+    Require XKB.
+    
+    Welcome to the future.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit dae1a78a521fa2e9fe7d058a66ae9ef7ea5d9471
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Jan 20 09:45:44 2009 +1100
+
+    Add automatic axis labeling.
+    
+    Since we don't support anything but REL/ABS x/y and sometimes pressure this is
+    bordering on pointlessness, but once the year of the Linux desktop comes
+    around this will be really handy. Or so.
+    
+    Also, we don't allow changing axis labels, but should eventually rearrange
+    them if swapaxis is on.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 263bf04a9d350dddd796f3a21c7b1749647be91c
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Jan 20 11:46:05 2009 +1100
+
+    Don't print xkb options twice to the log file.
+    
+    xf86SetStrOption already prints with X_CONFIG anyway, no need to do it again.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit c035f3d0f58698d0f1dbeb1be7ad00f0787d3292
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Jan 20 09:44:49 2009 +1100
+
+    Register the property handler AFTER setting all the properties.
+    
+    Otherwise, we add a new property based on a setting in pEvdev, which triggers
+    the update handler to change the setting in pEvdev based on the property.
+    Truly pointless.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit a7e8af65fca9c38a8c0c24ffc660c06c8d4a0b9b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Jan 19 21:23:34 2009 +1100
+
+    Test for pressure BEFORE using has_pressure.
+
+commit 0592d97fbb5a1241ee79397ce9203346d050a9f9
+Author: Michael Chapman <mike@very.puzzling.org>
+Date:   Fri Jan 9 19:07:10 2009 +1100
+
+    Disable middle mouse button emulation when a middle mouse button event is registered
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 4dfd86b2201b2b19761a1abb3c580cecf0060224
+Author: Matt Helsley <matt.helsley@gmail.com>
+Date:   Sun Jan 11 18:36:59 2009 -0800
+
+    Fix FOO_MAX off-by-one
+    
+    In linux/input.h each section's (e.g. ABS) FOO_MAX is the maximum FOO
+    value. Recent kernels define FOO_CNT as the maximum number of FOO there
+    will ever be. Hence using FOO_MAX to size the bit vectors representing
+    the capabilities of an evdev device is off by one.
+    
+    Define FOO_CNT values for use with Linux kernels which lack them. Use
+    FOO_CNT whenever we need to know the number of bits needed -- usually to
+    calculate the number of longs needed.
+    
+    When iterating over the values FOO_MAX still seems appropriate however
+    the loop test should include FOO_MAX rather than skip it.
+    
+    Signed-off-by: Matt Helsley <matt.helsley@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit d3fd42d8644310abcae23bbf534f8c445296bcb7
+Author: Matt Helsley <matt.helsley@gmail.com>
+Date:   Sun Jan 11 18:04:40 2009 -0800
+
+    rename NBITS to NLONGS to reflect its actual meaning
+    
+    NBITS really convers the number of bits passed as its argument
+    into a number of longs. This is somewhat atypical of many
+    function-like-macro names. Rename it to NLONGS.
+    
+    Signed-off-by: Matt Helsley <matt.helsley@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit dd1752ce3ffe9bdfa3e13dc075b7f22750e77fea
+Author: Matt Helsley <matt.helsley@gmail.com>
+Date:   Sat Jan 10 23:51:22 2009 -0800
+
+    Add pressure valuator
+    
+    If it's available report pressure as third valuator.
+    (Use xf86PostMotionEventP instead of the varargs wrapper.)
+    
+    Signed-off-by: Matt Helsley <matt.helsley@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 0f0a149067abdd1ed89717de43febe89b2a3490b
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Jan 9 16:13:09 2009 -0800
+
+    Remove xorgconfig & xorgcfg from See Also list in man page
+
+commit d170cba0cdd8f7a2e500e094f5b21fc33aefb52a
+Author: Yan Li <yan.i.li@intel.com>
+Date:   Mon Jan 5 16:35:09 2009 +0800
+
+    Fix XkbModel parsing error
+    
+    Signed-off-by: Yan Li <yan.i.li@intel.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 268038270593aae45e2740ad2151243383743c1d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Fri Dec 19 08:27:47 2008 +1000
+
+    Add dummy test device - simple device that doesn't move at all.
+    
+    Good for filling up the device list without getting distracted by spurious
+    events all the time.
+
+commit 0f36384d0636d6a8d3a8f182be69c72cccd1ff5c
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Mon Dec 8 12:32:31 2008 +0100
+
+    Revert "Keyboard: Disable kernel autorepeat"
+    
+    This reverts commit 6867652c2c8ad563d5655302d94134592b10265b.
+    Functionally replaced by commit ece72ce9e97adae23b1932dc1334f63669196d56
+    
+    Signed-off-by: Daniel Stone <daniel@fooishbar.org>
+
+commit ece72ce9e97adae23b1932dc1334f63669196d56
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Mon Dec 8 12:27:34 2008 +0100
+
+    Filter all repeated keys from kernel, because we do softrepeat in server
+    
+    Discard all repeated events that come from the device. The server will handle
+    per-key autorepeat in software.
+    
+    Signed-off-by: Daniel Stone <daniel@fooishbar.org>
+
+commit 2bf6e29b40f0da2bc417964fd2bd819306e5d3ed
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Nov 26 15:01:57 2008 +1000
+
+    Finalize MB emu (and wakeup handlers) before closing the fd.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit 2bd24649ecbae08b7bd4dacd67d141ae665f8db7
+Author: Tibi Nagy <nltibi@gmail.com>
+Date:   Mon Nov 24 22:28:44 2008 +0200
+
+    Support keyboards with scroll wheels.
+    
+    For keyboards, scroll events are reported by the kernel as EV_REL class events
+    of REL_WHEEL type. If, during probing, the device is found to support wheel
+    events, make sure it is set up as a pointing device, even if it doesn't have
+    buttons or doesn't report motion along the X and Y axis so that the scroll
+    events can be mapped to mouse wheel buttons (usually buttons 4 and 5).
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit 6867652c2c8ad563d5655302d94134592b10265b
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Thu Nov 27 13:24:08 2008 +1100
+
+    Keyboard: Disable kernel autorepeat
+    
+    We handle autorepeat in software due to per-key repeat and whatnot, so
+    disable the kernel's, which just interferes with ours.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 63af314368cec47b6b8266db331f2c820e7a071f
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Mon Nov 17 10:03:11 2008 +1000
+
+    Store device file's minor/major to avoid duplicate devices.
+    
+    Devices added that use the same min/maj as an already added device are ignored
+    by the driver. This way users can have an xorg.conf entry on
+    /dev/input/by-id/blahblah and not get the same device added by HAL.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit 4c5c9c111d406e5590429377262b86e91868ef76
+Author: Fernando Carrijo <fcarrijo@yahoo.com.br>
+Date:   Thu Nov 6 13:20:16 2008 -0500
+
+    Fix error message
+
+commit 4826969f23a0b298da2750c2e23a92b9d91819dd
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Mon Nov 3 13:25:06 2008 +1030
+
+    Add support for axes swapping.
+    
+    New option: SwapAxes (boolean)
+    New property: EVDEV_PROP_SWAP_AXES.
+    
+    Actual swapping code written by Donnie Berkholz.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit 33eb36f26663c09c873acede1b35e91ef4c64479
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Thu Oct 30 16:55:29 2008 +1030
+
+    Add support for run-time calibration.
+    
+    Some devices require run-time axis calibration. We can't change the min/max
+    ranges once we've initialised the valuator structs though, so in-driver
+    run-time calibration is required.
+    
+    If the property is set, the driver scales from the calibrated range to the
+    values reported to the X server (which then may scale to screen coordinates).
+    If the property is not set (i.e. zero items) no scaling is performed.
+
+commit d5cf24d3f0075a467e026592bfbb76b207dea8eb
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 29 16:54:16 2008 +1030
+
+    Add test/ directory for uinput-based test devices.
+    
+    Three test devices provided:
+    btn0 .... Provides BTN_0, BTN_1, BTN_2 instead of BTN_LEFT, BTN_MIDDLE,
+              BTN_RIGHT.
+    abs ..... Provdes x/y absolute axes, jumps between 100/100 and 120/120.
+    absrel .. Provides relative x/y axes and absolute x/y axes at the same time.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit 64554e4799a697d37dfd8be480f8eee636b9bea1
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 29 13:50:07 2008 +1030
+
+    Treat BTN_[0-2] as LMR buttons if necessary.
+    
+    Treat BTN_[0-2] as LMR buttons on devices that do not advertise BTN_LEFT,
+    BTN_MIDDLE, BTN_RIGHT (e.g. 3Dconnexion SpaceNavigator).
+    
+    Otherwise, treat BTN_[0+n] as button 5+n. Note: This causes duplicate
+    mappings for BTN_0 + n and  BTN_SIDE + n.
+    
+    This also fixes a bug where we could end up with negative button numbers after
+    trying to map BTN_0.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit b77f9398570fb8eae1fcf50bc3c10c9c390c6bac
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 29 13:28:19 2008 +1030
+
+    Remove obsolete FIXME
+    
+    xkeyboard-config's maps are perfectly able to cope with evdev now.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit a43ab4999b9cad10f77aa6c703d3c61b754f1fd4
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 28 12:09:26 2008 +1030
+
+    Flush input after re-opening the fd.
+    
+    Suggested by Julien Cristau.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit af096e8c5d8b425f725a37bf4a98e205e70716e9
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Mon Oct 27 15:54:49 2008 +1030
+
+    emuMB: add EvdevMBEmuOn and call from EvdevOn to register wakeup handlers.
+    
+    This got broken in b0737bdbd1f6e601eb4984b6f4cb49279190984c, when the
+    EmuMBPreInit call was removed from EvdevOn. As a result, VT switching away and
+    back wouldn't restore the wakeup handlers and mouse button presses
+    disappeared.
+
+commit 12498042fcc08e34aef0117ce84192f59542fd56
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Fri Oct 24 13:09:46 2008 +1030
+
+    Fix axis inversion for absolute coordinates.
+    
+    If min_x/y was not equal to 0, the inverted calculated range was off and leads
+    to inaccessible or out-of-range areas.
+
+commit 0f8fcfccb3251ee3df80d90ae5d7df638722d24e
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Fri Oct 24 09:21:36 2008 +1030
+
+    emulate MB: fix confusing log message.
+    
+    If we're forcing MB emulation behaviour as per config, then at least state
+    whether we're forcing it off or on.
+    
+    Found by Michel Dänzer.
+
+commit 0ab4c09e504ba3822c5e030732b770140165e725
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Thu Oct 23 14:05:41 2008 +1030
+
+    Silence compiler warning by memsetting the struct properly.
+
+commit d348eb8ce78640363c159e1a4fdbfa9b596fa5bb
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Thu Oct 23 13:22:17 2008 +1030
+
+    MB emulation timeout is stored as Time, make the property 32-bit too.
+
+commit 2c1698fa615a083de7dd647622a302d5de77dc0c
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 22 18:01:58 2008 +1030
+
+    Init ioctl bitmasks to 0, shuts up valgrind too.
+
+commit 8c39302594445ba774ea3fec66417492cc5643e0
+Author: Søren Hauberg <hauberg@gmail.com>
+Date:   Wed Oct 1 11:06:31 2008 +0930
+
+    Add touchscreen support.
+    
+    Touchscreens are devices that do not have buttons and only advertise
+    BTN_TOUCH. Add a new flag to note the device type.
+    
+    If BTN_TOUCH is detected, change it to BTN_LEFT and process it normally.
+
+commit f57e8face94c9e6986b35ca2ec231e284b9f58cf
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Tue Oct 21 19:21:21 2008 +0200
+
+    Fix TestBit() on 64bit
+    
+    Reported by Albert Damen <albrt@gmx.net>
+    X.Org Bug#18150 <http://bugs.freedesktop.org/show_bug.cgi?id=18150>
+
+commit 4912e2aa7f867a86d383010023b8426c881fb3b0
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Thu Oct 16 15:23:06 2008 +1030
+
+    Add option "GrabDevice", don't grab the device by default.
+    
+    We now have the matching code in the server to set the console to RAW mode and
+    don't need to grab the devices anymore.
+    
+    This is an updated version of e8534d47c8524ac081c2e3e6ebaabe4c6b274a18, which
+    was reverted in 6dc41991557fa55a9e2f5aaf0fe40c70a08d41fd.
+
+commit 7243116f55609a2a5f73bb88cf6ad6386c9bbc0b
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Oct 16 22:35:42 2008 +1030
+
+    Don't post keycodes > 255.
+    
+    If we only have keys > 255 we don't set up a key class rec, so don't post
+    them. It makes the server unhappy.
+    
+    Signed-off-by: Julien Cristau <jcristau@debian.org>
+
+commit 0089d931ac5fb290c82908da652b28c8b515d449
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 14 17:02:43 2008 +1030
+
+    Fix "Device reopened after N attempts" message.
+
+commit 0f5a5ac09ebc89e984b72d395475bb9f412e240c
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 14 16:45:44 2008 +1030
+
+    Don't init draglock, etc. if we don't have the required capabilities.
+
+commit 36d68b006d6bb3d41c93888acead73043ca304a1
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 14 16:41:54 2008 +1030
+
+    8-bit properties should use 8-bit storage types...
+
+commit bb1f42168761b928478a9cb066457b525c41ddd9
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 14 16:25:27 2008 +1030
+
+    Don't include the client-side header anymore. xkbstr.h is server SDK.
+
+commit 0405f7b17fb0ce5cadcc6c5aa6eeb61bdacdf9cd
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 14 16:21:00 2008 +1030
+
+    Tidy up evdev.h
+    
+    This includes shuffling some functions around so we don't need the prototypes
+    in evdev.h.
+
+commit 088e0a175a4913bf827c1f7e19de09fdf987d347
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 14 16:14:13 2008 +1030
+
+    Rename DragLockInit to DragLockPreInit, remove superfluous "return".
+
+commit cefedeb205291001e7e47b7516de261dbccce059
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 14 16:12:13 2008 +1030
+
+    Register property handler from within the modules, not the main evdev file.
+
+commit b0737bdbd1f6e601eb4984b6f4cb49279190984c
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 14 16:09:20 2008 +1030
+
+    Clean up program flow - don't call PreInit for "modules" on DEVICE_INIT.
+    
+    Call the PreInit functions for MB Emulation, wheel emu, and draglock during
+    PreInit, not on DEVICE_INIT. This way, we only parse the options once and
+    don't overwrite with defaults when coming back from a VT switch.
+
+commit 5f2c8a2dcdf98b39997ee5e7c9a9ace3b640bfa3
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 14 16:01:17 2008 +1030
+
+    Janitor: clean up xf86Msg use, might as well use X_CONFIG directly.
+
+commit ff783fce65a63707555098759692b22147646263
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 14 15:30:20 2008 +1030
+
+    Add property support for ReopenAttempts option.
+
+commit c638aa4a88116a1219cf4941aacd630e070db099
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 14 15:06:40 2008 +1030
+
+    Document properties in man page.
+
+commit b46677e346c33379cac814895641349cbd3b37f2
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Oct 14 15:06:17 2008 +1030
+
+    Document InvertX/Y options.
+
+commit 680b41dc7681cd611ed385af8009489be6071a41
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Mon Oct 13 17:08:22 2008 +1030
+
+    Bump to 2.1.99.
+
+commit 9065d0ccb26d013f26570d29c332bf1c93fabb2d
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 8 16:16:58 2008 +1030
+
+    Remove "Path" option.
+    
+    Path was just an alias for Device anyway, so we might as well not parse it.
+    By now you should be using HAL anyway which fills in Device for you.
+
+commit a9fcce1833f167ed8aa79d4dbfbbc3d6bca2e7fd
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 8 16:15:14 2008 +1030
+
+    Remove parsing of ScreenNumber option.
+    
+    Was unused anyway, so we might as well not parse it.
+
+commit ab934d840dac8df761691533985a9d998ec5e21e
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 8 16:14:51 2008 +1030
+
+    Janitor: purge unused headers, reshuffle for readability, fix whitespace errors.
+
+commit 6f6ac982951165a6ac77b3e32750c47780ea4990
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 8 14:25:53 2008 +1030
+
+    Add checkonly handling to property handlers.
+    
+    If checkonly is TRUE, we can only check if applying the value would succeed.
+    The value is actually applied if checkonly is FALSE.
+
+commit a2633c807812e6e8ad9c82e2a5940dfbf370aff5
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 8 14:52:13 2008 +1030
+
+    Fix up bad return code in draglock property handler.
+
+commit e6c699dedcd6f3b5db497fe2d226806ca4bbe683
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 8 14:35:12 2008 +1030
+
+    Stricter value checking for property changes.
+
+commit 847eac826286e6202f42b9a2ccc160a232a710a3
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Sat Oct 11 02:10:48 2008 +0200
+
+    Set pInfo->fd to -1 on DEVICE_CLOSE
+    
+    This allows the reopen logic to kick in later.
+    DEVICE_CLOSE gets called on regen, so without this we'd keep a stale
+    file descriptor in pInfo->fd in subsequent sessions.
+    
+    Debian bug#496101 (http://bugs.debian.org/496101)
+
+commit a196672a6bafd4e7d3a2cca991a2a3bf4bdcd952
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 1 13:58:24 2008 +0930
+
+    Add property support for axis inversion.
+
+commit 3985d423204217a1f072fa6e0145cba547f79a97
+Author: Søren Hauberg <hauberg@gmail.com>
+Date:   Wed Oct 1 11:07:57 2008 +0930
+
+    Add support for axis inversion.
+
+commit e138e4b79a750e22712802b84bf36a70a929d12f
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Fri Sep 26 10:42:05 2008 +0930
+
+    Install xorg-evdev.pc for clients who need evdev-properties.h
+
+commit 125e2b8ce23b8ceea250ae52ba69cd14af5592f9
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Thu Oct 2 10:56:04 2008 +0930
+
+    Close fd on DEVICE_OFF. (LP #276887)
+    
+    Leaving the fd open means we still get keyboard events after VT switching
+    away. Coming back, some of these events are replayed on the application that
+    has the current focus.
+    
+    Reproduceable:
+    1. open terminal, focus.
+    2. VT switch away
+    3. type something, preferably a password
+    4. VT switch back, trigger a mouse event
+    5. Observe the X server guessing your password.
+    
+    Closing the fd on DEVICE_OFF fixes this. Reopen is handled by the reopen
+    code introduced with
+    
+        commit 9930477cbeb4acfd070ae70894d13ffabfc347b8
+        Author: Peter Hutterer <peter.hutterer@redhat.com>
+        Date:   Tue Aug 26 14:33:40 2008 +0930
+    
+            Attempt to re-open devices on read errors.
+    
+    Launchpad Bug 276887
+    <https://bugs.edge.launchpad.net/ubuntu/+source/xorg-server/+bug/276887>
+
+commit 91bc0a0ba3c4c941b2b7695b6d4f303fb7128fd9
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 1 13:36:09 2008 +0930
+
+    Remove useless initialization of rc.
+
+commit 4c55186aedd9030ac46654cee18b09173db988e8
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Wed Oct 1 13:58:47 2008 +0930
+
+    Change DragLock atom name - prepend with Evdev.
+
+commit 62069b97d216fb9b4e7db0c60f87ab006ad7011c
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Fri Sep 26 10:57:07 2008 +0930
+
+    Move misplaced #endif
+
+commit 2718a5c56b9f34360738b6525c89ea0af4c368d1
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Fri Sep 26 10:46:47 2008 +0930
+
+    Register property handlers directly, instead of abstracting them.
+    
+    This removes a left-over from the early device property code where we could
+    only have a single handler. Now it's easier to just register the handlers for
+    each subsystem (emulate wheel, draglock and MB emulation).
+
+commit 90d1d494f82255b07d07800d8270ad754163b7ab
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Fri Sep 26 13:49:28 2008 +0930
+
+    Cleanup: "valid_vals" should be "vals" now.
+
+commit a77c2622cc7979cea6c1549f1978fae575b76c6c
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Fri Sep 26 13:47:24 2008 +0930
+
+    Add evdev-properties.h file with #defines for all property names.
+
+commit 84a0e39c0dd8bcc80d4f6912562260c1771f311f
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Thu Sep 18 16:44:27 2008 +0930
+
+    Use new property API (no ConfigureDP, less args to ChangeDP)
+    
+    Return appropriate status codes from property handlers.
+    Make properties non-deletable.
+
+commit 73869372212f7afc18e02184f347bcd94ce19d04
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Thu Sep 18 16:47:35 2008 +0930
+
+    draglock: Shut up compiler warning.
+
+commit fcf8375f2b960993686bd08fd4d0e2d8623b4680
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Fri Sep 26 12:53:29 2008 +0930
+
+    Don't require randrproto.
+
+commit 9930477cbeb4acfd070ae70894d13ffabfc347b8
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Tue Aug 26 14:33:40 2008 +0930
+
+    Attempt to re-open devices on read errors.
+    
+    Coming back from resume may leave us with a file descriptor that can be opened
+    but fails on the first read (ENODEV).
+    In this case, try to open the device until it becomes available or until the
+    predefined count expires. To be safe, we cache the information from the device
+    and compare against it when we re-open. This way we ensure that if the
+    topology changes under us, we don't open a completely different device. If a
+    device has changed, we disable it.
+    
+    Adds option "ReopenAttempts" <int>
+
+commit 4509ec1daf8a03b261c1fa8aa48b5def3f336aed
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Thu Sep 4 18:22:56 2008 +0930
+
+    Use HAVE_PROPERTIES define instead of GET_ABI_MAJOR for property compilation.
+
+commit a205dfc091e6d7c67e3fa1421fe8a43f5ed40b00
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Fri Aug 22 14:07:17 2008 +0930
+
+    Shut up "unused variable" compiler warnings.
+    
+    Hide properties behind ifdefs, fake use of "val".
+
+commit 184206e7174dc08239d6a78a1ca912176e3f6229
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Mon Aug 25 17:24:15 2008 +0930
+
+    Wheel emulation: initial values must be char.
+    
+    parsing int* to char* in XIChangeDeviceProperty means we lose values.
+
+commit 79ff677c52d38f67144f09bd534aaef862946a5e
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Fri Aug 22 09:00:13 2008 +0930
+
+    Init all emulateWheel values, even if EmulateWheel is disabled.
+    
+    Even if we don't want EmulateWheel, we can at least init everything to usable
+    values. This way we only need to toggle "enabled", rather than initialising
+    the whole lot before usage.
+
+commit 37e3addf89923bfc1e7ae23b678614f4ca926dcf
+Author: Dan Nicholson <dbn.lists@gmail.com>
+Date:   Wed Aug 20 18:16:41 2008 -0700
+
+    Add wheel timeout property support
+    
+    Copied from the wheel inertia property support.
+    
+    Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit e237de0dea9fe24e1c4efc78523bfdd86ed73876
+Author: Dan Nicholson <dbn.lists@gmail.com>
+Date:   Wed Aug 20 18:16:40 2008 -0700
+
+    Add timeout support for mouse wheel emulation
+    
+    Support the EmulateWheelTimeout option as the mouse driver does.
+    
+    Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit 92c6611b6f4495103fccea38dcafc6c6bf18049a
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Mon Aug 18 12:13:15 2008 +0930
+
+    Add property support for drag lock.
+
+commit bd405ddc83b9ad1ceed47f572245fccae598e6bb
+Author: Chris Salch <emeraldd.chris@gmail.com>
+Date:   Sun Aug 17 12:31:23 2008 -0500
+
+    Adding in DragLockButtons functionality.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit 36d702006d5aace50083ca52b7065d465b497077
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Sat Aug 16 15:33:23 2008 +0300
+
+    Force rules, not model, to be evdev
+    
+    xkeyboard-config recently changed to a separate ruleset for the evdev
+    driver, so match that by only forcing the ruleset, not the model, to be
+    evdev.
+
+commit 6dc41991557fa55a9e2f5aaf0fe40c70a08d41fd
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Fri Aug 15 09:23:02 2008 +0930
+
+    Revert "Don't grab devices unless specified through the config options."
+    
+    Not such a good idea, CTRL+C terminates the server and other issues. Reverting
+    for now until a better solution is found, at least this way the driver is
+    usable.
+    
+    See also: http://lists.freedesktop.org/archives/xorg/2008-August/038032.html
+    
+    This reverts commit e8534d47c8524ac081c2e3e6ebaabe4c6b274a18.
+
+commit e8534d47c8524ac081c2e3e6ebaabe4c6b274a18
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Thu Aug 14 13:38:50 2008 +0930
+
+    Don't grab devices unless specified through the config options.
+    
+    Grabbing event devices stops in-kernel event forwarding, most notably rfkill
+    and the "Macintosh mouse button emulation" device. Let's not do that.
+    
+    Option "GrabDevice" forces grabbing the device.
+
+commit 555f5a7cbf3c980c436c205e9b23a78f3e19bdfe
+Author: Chris Salch <chrissalch@letu.edu>
+Date:   Fri Aug 8 15:56:27 2008 +0930
+
+    Filter wheel events before middle mouse button emulation.
+    
+    The Emulate3Button needs to be the last filter function, otherwise the timeout
+    code causes it to hijack button presses for the first 3 buttons.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
+
+commit 134829d911c698704595014ba402516ae9a2f36c
+Author: Peter Hutterer <peter.hutterer@redhat.com>
+Date:   Thu Aug 7 17:34:54 2008 +0930
+
+    Simplify the property handler registration.
+    
+    Instead of having separate handlers for each property, just handle all of them
+    in one handler for emuMB, and one handler for emuWheel.
+
+commit 4e121b297ee0a9b179f8188926564fb8b2c3f6c8
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Aug 7 16:57:06 2008 +0930
+
+    Add EVDEV_MAXBUTTONS instead of checking against 32.
+    
+    Numbers are so lame, defines are all the rage now I've heard.
+
+commit 9793de81373bb78b9ddbb2487e0af5d2ddd0b246
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Aug 7 16:53:51 2008 +0930
+
+    Expose wheel emulation through device properties.
+    
+    Don't enable wheel emulation with 0 inertia - bad things happen.
+
+commit a9d72b40fbe178fa4fbb9d0e7c02dc6c5250969a
+Author: Chris Salch <emeraldd.chris@gmail.com>
+Date:   Wed Aug 6 22:08:13 2008 -0500
+
+    Adding mouse wheel emulation code.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit c1f7f8c3d22ecae7839f82ea8b584069f54f1f5e
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Thu Aug 7 09:21:26 2008 +0930
+
+    Print a warning if a keycode exceeds the range accepted by the server.
+    
+    Keycodes over 255 are silently ignored in the server. The least we can do is
+    put a warning in the logs.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 40e1474d84c09d93197ac5db34a88e654386e68f
+Author: Chris Salch <emeraldd.chris@gmail.com>
+Date:   Mon Aug 4 20:19:47 2008 -0500
+
+    Adding a function to map button events to button numbers.
+    
+    Remove code duplication, let the mapping function hand us the actual button
+    event to be passed up to the server.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit d9097df01b01afaf946fa04fca8ae8ab7108ff21
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Mon Aug 4 09:16:53 2008 +0930
+
+    Actually close the fd on DEVICE_CLOSE (bug#16948)
+    
+    Fixes file descriptor leak.
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 5c074af5a9abba138023e3bc6954d1062f7c36dd
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Wed Jul 30 10:40:47 2008 +0200
+
+    Print the device name when we get a read error
+
+commit 72551662a09eedf696508aaacf6aa02c0254e4de
+Author: Michel Dänzer <michel@tungstengraphics.com>
+Date:   Tue Jul 29 10:06:07 2008 +0200
+
+    xf86-input-evdev: Fix EVIOCGBIT ioctl usage on big endian platforms.
+    
+    With this fix, on my PowerBook HAL hotplugging correctly detects my USB mouse,
+    and no longer thinks keyboards have random numbers of mouse buttons. :)
+    
+    The LONG_BITS and NBITS macro definitions are stolen from xf86-input-synaptics.
+    
+    Signed-off-by: Michel Dänzer <michel@tungstengraphics.com>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit 53e7525744cd7c47707c7339f0b771f59f99b97c
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Jul 21 18:15:35 2008 +0930
+
+    Add support for ButtonMapping option.
+
+commit 5d13259a5ddab31dbb2158975c8ccbb1f3c99046
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Mon Jul 21 13:10:06 2008 +0930
+
+    Guard property changes against ABI_XINPUT < 3.
+
+commit 2b7edaa4ab88e192d7285d39b4834d1e535b94d0
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Sun Jul 20 11:33:37 2008 +0200
+
+    Fill up the version info
+    
+    Report correct versions instead of
+    "compiled for 0.0.0, module version = 1.0.0"
+
+commit bf0d81011e19a8bb5bbd80c6b496c8ae257b4f2c
+Author: Peter Hutterer <whot@possum.(none)>
+Date:   Mon Jul 14 13:06:32 2008 +0930
+
+    Don't enable the device if the grab failed with ENODEV.
+    
+    After suspend/resume, sometimes the device doesn't come back up on the same
+    node. Since we do not call PreInit for the device (which would detect this
+    situation), we continue to try to read a nonexisting file, spamming the log
+    file with "Read Error".
+
+commit ef4bb69c1a64e784fef1c758ee439372ba329b0a
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 10 19:32:22 2008 +0930
+
+    Add .gitignore file.
+
+commit d1818ef2066d7e526e0f64fffd41e06061ceb017
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Jul 8 16:37:42 2008 +0930
+
+    Add support for device properties, currently MB emulation and timeout.
+
+commit a9223edcd869288cf6e90f2214e607db510c7027
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 10 16:55:21 2008 +0930
+
+    Clean out configure.ac
+    
+    We're not building with or without XInput. Same with xkb.
+
+commit ec23c6b2f550f2679226da907c1d022295d453f1
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 3 15:01:32 2008 +0930
+
+    Remove static ChangeLog, autogenerate as part of make dist.
+    
+    Hook taken from xserver's Makefile.am
+
+commit 18d70d796fe68116907d86fc27ed77528a51ff1d
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 3 14:50:45 2008 +0930
+
+    Update COPYING with the correct copyright info.
+    
+    Fix up licence of emuMB.c, was using Red Hat instead of "The authors", but
+    this code wasn't contributed by RH anyway.
+
+commit 37b854cb643fa9c5087eccdd1b6ba940d5413bf9
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 3 14:45:41 2008 +0930
+
+    Remove stale comments.
+    
+    Ctrl+Alt+Backspace works, I'm using it daily.
+    CapsLock doesn't repeat, otherwise we wouldn't have Bug 16318.
+
+commit 8c06093191761f9bd2f3c5eb0b57d7b9feca70bc
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Thu Jul 3 14:44:52 2008 +0930
+
+    Remove EvdevConvert, nobody calls it now anyway.
+    
+    Conversion is now done in the DIX.
+
+commit 0830676a0ce3618eae9cf4c072998c16e164c687
+Author: Ander Conselvan de Oliveira <ander@mandriva.com.br>
+Date:   Thu Jun 26 14:36:58 2008 -0300
+
+    Mice with a lot of buttons (e.g. Logitech MX1000) generate button events greater than BTN_TASK.
+    
+    Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
+
+commit 1cf7b8f7ee224d823d94ea65458f5269a1a77d2e
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Sat Jun 28 17:50:26 2008 +0930
+
+    Count buttons at probe and print to log.
+    
+    We don't really do anything with the number other than print it since I'm sure
+    that half the mice don't report the correct number anyway (especially with the
+    wheel button mapping). But having a bit more debug info is good.
+
+commit 826e6e7dd408659af9a1751ed16e437db8c8dc34
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Sun Jun 22 17:52:40 2008 +0930
+
+    Bump to 2.0.99.
+
+commit 5a0ea39b79b27b7c3117661a21e7ab5eba3c9b24
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Sat Jun 21 16:42:12 2008 +0930
+
+    No need to finalize MB emulation after EvdevProbe anymore.
+    
+    Follow-up to 76800bfa75807e49398380b902f6c0f547cd4c0e.
+
+commit 373e13ae353d1e0022f8821adc528ebc5411d47d
+Author: Simon Munton <simon@munton.demon.co.uk>
+Date:   Sat Jun 21 10:19:07 2008 +0930
+
+    Close file descriptor if EvdevProbe fails.
+    
+    Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
+
+commit 76800bfa75807e49398380b902f6c0f547cd4c0e
+Author: Keith Packard <keithp@keithp.com>
+Date:   Fri Jun 20 18:20:55 2008 -0700
+
+    Enable middle button emulation at DEVICE_ON instead of DEVICE_INIT.
+    
+    This ensures that the middle button emulation is re-enabled after VT switch,
+    otherwise the block handler that deals with the timeouts would not get
+    re-registered.
+    
+    Signed-off-by: Keith Packard <keithp@keithp.com>
+
+commit 04003a98a9ca1b4b0c32d319fab07ee7afc83c75
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Tue Jun 17 14:01:49 2008 +0930
+
+    evdev 2.0.0
+
+commit 0443fb430f2481c1f0d0d83730a9145b5794f559
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Tue Jun 17 13:59:15 2008 +0930
+
+    Shut up compiler warning "implicit declaration of function 'xf86Msg'"
+
+commit 998f52010f92dc79f2ace6048a2f3fd600a97582
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Thu Jun 12 11:23:10 2008 +0930
+
+    Finalize MB emulation if EvdevProbe fails.
+    
+    This avoids segfaults when HAL is restarted behind our backs. Also, only init
+    MB emulation when the device actually has a button.
+
+commit de07c04f5c2874b8e407913c3121e715e46653d2
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Wed Jun 11 11:24:07 2008 +0930
+
+    evdev 1.99.4
+    
+    1.99.3 had a nasty bug, so here's a quick update.
+
+commit 01355b9d4b3ed92da42f90fb69384eb22cdcb3d9
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Wed Jun 11 11:19:04 2008 +0930
+
+    If Emulate3Buttons is specified in the config, don't auto-deactivate it.
+    
+    Default setting is still "on" until middle button is pressed.  If the options
+    is however explicitly stated in the config file, it takes the value from the
+    config file, no matter if a middle button is present.
+
+commit 9591dc1f6cc89208805b120eabd055e8dabd3e40
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Wed Jun 11 10:36:00 2008 +0930
+
+    Remove wakeup handlers when device is closed.
+    
+    Less SIGABRTs are less exciting, but sometimes boredom is what we want.
+
+commit 08ba40b2532bd61b60c9cf994b21300f596f7ebd
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Tue Jun 10 17:35:33 2008 -0400
+
+    evdev 1.99.3
+
+commit 39dc453691804648f34dbd856bd7e66cfdc59d66
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Tue Jun 10 22:48:01 2008 +0930
+
+    Disable middle mouse button emulation when a real middle MB event is detected.
+    
+    Devices may report middle mouse buttons even if they don't have one (PS/2
+    devices just don't know any better), so we can't be sure until we see the
+    event.
+
+commit e8887435ac065ec3071b2d8bf0895e8cb196ec3d
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Tue Jun 10 15:55:40 2008 +0930
+
+    Enable middle-mouse button emulation.
+    
+    Ported from xf86-input-mouse, with a few cleanups.
+
+commit b0f6987ee6b133e28f3af18da62cfb5ca79fbe07
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Tue Jun 10 22:41:43 2008 +0930
+
+    Plug a memory leak, we allocated pEvdev twice, dropping the first memory area.
+
+commit fec73e1418a4da1b64496faca27b06fef0aa5206
+Author: Sven Wegener <swegener@gentoo.org>
+Date:   Sat Jun 7 13:01:22 2008 +0200
+
+    evdev: Port b4a5a204 "Fix pointer crossing screen bug." to current master branch
+    
+    The commit b4a5a204 fixed an issue, where we can't move the pointer to
+    other screens and this happens in current master branch again. This commit
+    ports the old commit to the current master branch.
+    
+    Signed-off-by: Sven Wegener <swegener@gentoo.org>
+    Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
+
+commit da112737eb109dc263169e820b7ef903b7f8624f
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Sun Jun 8 00:12:03 2008 +0930
+
+    Check for XINPUT ABI < 3 (corrected version)
+    
+    Thanks to Sven Wegener for pointing out the incorrect previous version.
+
+commit d40125ea8c2ce6ec0f98bdc0655f79aa7274152e
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Sun Jun 8 00:09:40 2008 +0930
+
+    Revert "Check for XINPUT ABI, parameters of InitValuatorClassRec have changed."
+    
+    GetMotionEvents() doesn't exist, led to compile errors with servers pre-MPX
+    merge. Thanks to Sven Wegener for pointing this out.
+    
+    This reverts commit 42422d8f69e6806e1adfd93017cac064a75041c7.
+
+commit 42422d8f69e6806e1adfd93017cac064a75041c7
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Mon May 26 19:17:19 2008 +0930
+
+    Check for XINPUT ABI, parameters of InitValuatorClassRec have changed.
+
+commit 15e0091f0b4b0d7dff29da143d405255a1c3bc12
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Wed May 21 16:48:32 2008 +0930
+
+    Fail if the device cannot be grabbed during the probe.
+    
+    If the grab fails, this is most likely a sign that the device has been grabbed
+    already (probably by a device specified in xorg.conf). So let's not add the
+    device to the server's input device list, since it won't generate events
+    anyway.
+    
+    Exception: keyboards and kernel 2.4 are not affected.
+
+commit d45f315845e19a720af25dc5f6c8a4c654c6e225
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Wed May 21 15:05:10 2008 -0400
+
+    evdev 1.99.2
+
+commit a4a7003f7c82ddf05d3aa88fa40698058648dbf6
+Author: Dan A. Dickey <dan.dickey@savvis.net>
+Date:   Tue May 20 10:57:06 2008 +0930
+
+    Fix a trivial bug in testing for absolute axes.
+    
+    Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
+
+commit 3e0dc9945d795cfd51ffe176100fa9416b6d3c4d
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Mon May 19 08:36:20 2008 +0930
+
+    Shut up two compiler warnings.
+
+commit ff6251a2bd347eef7b3cd80825e84d983eeecfd3
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Mon May 19 08:24:55 2008 +0930
+
+    Remove unused EvdevOpts and EvdevOptions.
+    
+    In the mouse driver, these options are only used if XFree86LOADER is
+    undefined. configure.ac in the xserver forces said define to 1 if we're
+    building the xfree86 DDX, so I don't see the point of having them around.
+    Especially since they weren't used in evdev anyway.
+
+commit e9222a828582e560f9c3a29f0d3d9e1e46d973bd
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Sun May 18 11:04:43 2008 +0930
+
+    man: Option "Path" is supported in the code, add it to man page.
+
+commit 8b7738457feef13e1fab88bb30c94093dd8bfcc5
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Wed Apr 30 18:10:08 2008 +0930
+
+    Don't allow relative and absolute axes on the same device.
+    
+    This is a bit of a mess. The MS Optical Desktop 2000 registers both relative
+    and absolute axes on the same device (the mouse). The absolute axes have a
+    valid min/max range for x/y and thus overwrite the x/y relative axes in the
+    server (no, this is not a server bug). And I wouldn't be surprised if other
+    devices have similar issues.
+    
+    Since the device only sends relative events after that, the mouse is
+    essentially restricted to the min..max range of 0..255. The server simply
+    doesn't do unrestricted relative axis and restricted absolute axis on the same
+    device (not for the same axis numbers anyway).
+
+commit 1b9deb8e7e50a905f94a371ab0aa39e09a703052
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Tue Apr 1 17:24:13 2008 +0200
+
+    Add XK_Meta_L and XK_Meta_R to list of modifiers
+    
+    Stopps meta/super key from autorepeating
+
+commit 0ec391f51cef4550daef041110ed93699089bea3
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Fri Mar 28 17:45:05 2008 +0200
+
+    Keyboard: Don't allow arbitrary keymap settings
+    
+    Pretty much dead code anyway.
+
+commit f77410e1f97d394e98c854fd174f712666b0544c
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Fri Mar 14 11:15:01 2008 -0400
+
+    Map REL_DIAL to REL_HWHEEL.
+    
+    Some Microsoft mice have this wrong.  And it seems like a sensible thing
+    to do anyway.
+
+commit d28c2e1efba9fd3e79d9dfecf23cdbded30b93f5
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Wed Mar 12 13:54:10 2008 -0400
+
+    Filter out repeat events for mouse buttons.
+    
+    Not many mice do this, but some do, Apple Mighty Mouse in particular, and
+    it makes click-and-drag pretty much impossible to use.
+    
+    Arguably we should filter _all_ repeat events from the kernel and handle
+    synthesizing them in the server.
+
+commit 697e850a6387cf1e0a0a35ca8c694804a6c2427f
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Tue Mar 11 19:07:58 2008 -0400
+
+    Fix middle/right button munging.
+    
+    Don't do this in the button map.  That's writeable by clients, which means
+    they have the chance to get it wrong.  Just swap right and middle around
+    in event dispatch before you get to the user's map.
+
+commit 87037b9953ebd47e9dbd99b3653050517aa490ff
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Mon Mar 10 17:16:38 2008 -0400
+
+    Force xkb_model to be "evdev".
+    
+    Or at least, refuse to recognise the config option.  It's nonsensical to
+    use a model of something other than evdev, and it'll just break if you try.
+
+commit 71f4eaec7713643a7e2d07e27b9afeabd6f1ce02
+Author: Dan Nicholson <dbn.lists@gmail.com>
+Date:   Sun Mar 9 14:46:56 2008 -0700
+
+    Fix cut-and-paste errors in xkb alternate spellings code
+    
+    Fixes 2b334d6b69d7dde5d553c638e134ebdf974749f3.
+
+commit 72083976127a1ff15f79b0316570a947e6dd2b42
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Sun Mar 9 16:15:14 2008 -0400
+
+    Fix cut-and-paste error in abs-to-rel translation.
+
+commit c250f843833b1aac3732ca97af5b1c0076996598
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Sun Mar 9 15:54:27 2008 -0400
+
+    Fix the default XKB rules to be "base" instead of "xfree86".
+
+commit 2b334d6b69d7dde5d553c638e134ebdf974749f3
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Sun Mar 9 15:53:40 2008 -0400
+
+    Handle the alternate spellings of the xkb options.
+
+commit 9773dac6238b64cab1d42b2231097b23058c44ee
+Merge: 11cf9c9 1a0bc8e
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Sat Mar 8 20:18:02 2008 -0500
+
+    Merge branch 'evdev-2.0-branch'
+    
+    This resets to before the ad-hoc input hotplug state, ports that to
+    current server ABI, adds input hotplug integration, and re-adds support
+    for absolute coordinate events and XKB.  Several other small fixes were
+    cherry-picked from the new 1.2 branch.
+
+commit 1a0bc8e64a9ba6e8647b5908673b57710518f6c2
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Sat Mar 8 20:01:15 2008 -0500
+
+    Force maximum keycode to be 255
+    
+    Even though we don't have keycodes for anything above 127, make sure our
+    map always covers up to 255.  This ensures that the keycode range never
+    changes.
+    
+    Spiritually cherry-picked from a9e87f29ccdadebb0742317bb57d66eaaca4b593
+    and 6db4a9fb84f828f745202c3fddc58d389fca220b.
+
+commit 6271494faa4c45f4fa10509f72e0515f2cef36c6
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Sat Mar 8 19:54:44 2008 -0500
+
+    Add absolute coordinate event support.
+    
+    There are two major classes here, touchscreens and touchpads.  Touchpads
+    are logically more like relative devices, in that your initial touch
+    should not warp the cursor.  So attempt to detect touchpads (via the
+    existence of BTN_TOUCH) and translate absolute events from those devices
+    to relative motion.
+
+commit f5bfc7ec3c132276ab7152b283f75387ee656ec2
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Sat Mar 8 16:52:17 2008 -0500
+
+    Nuke the keyboard bell code.
+    
+    It did nothing, and the core won't invoke it anymore anyway.
+
+commit bf0848ec8e1ab45cb72fc8da0cc5dc47eefd0760
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Sat Mar 8 16:37:42 2008 -0500
+
+    Re-add XKB support.
+    
+    Almost entirely taken from a patch I did ages ago in bug #3912, with
+    slight cleanups, and with the KcCGST options removed as per evdev 1.x.
+
+commit f1445feac77af65098eef1c2d86ae067d81fc6cb
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Sat Mar 8 16:09:47 2008 -0500
+
+    Parse Option "Path" as well as Option "Device".
+    
+    The hotplug core passes Path not Device.  With this change, hotplugging
+    works.
+
+commit ad5bdcb50f511b1cd3bd0118d2b1f4fe58c4ab72
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Fri Mar 7 20:29:58 2008 -0500
+
+    Ignore button events above BTN_TASK for now.
+
+commit bb36ca65c64d1d863f8fa4e6f058a384fbc80eb0
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Fri Mar 7 19:43:07 2008 -0500
+
+    Support the new DIX motion history API
+    
+    Spiritually cherry-picked from 036b457c1b3f7d2d174da890cb8598d907181f8e
+
+commit 40a1e1439c120d791a2f106293f4a712c452fcc5
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Sun Jul 9 18:08:50 2006 +0100
+
+    remove XFree86LOADER usage
+    Build evdevModuleData, et al, unconditionally.
+
+commit 946beb16f8002e8f52af082d424aac74e6fd34a9
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Fri Mar 7 19:09:35 2008 -0500
+
+    Unlibcwrap.
+
+commit 305f90d37ad200063589c5ecf946474a09f0349b
+Author: Adam Jackson <ajax@redhat.com>
+Date:   Fri Mar 7 19:06:14 2008 -0500
+
+    Branch for evdev 2.0
+
+commit 11cf9c92c0d31d1058ec6c013b7126bd8909beba
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Mon Mar 3 13:40:52 2008 +0200
+
+    Updated manpage to reflect current state
+    
+    Large parts of the manpage were obsolete and confused users. Current state should reflect all available driver options. Some details are still missing.
+
+commit 7f1e8146d4b13929a86a4b80f783a720c1b5573a
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Wed Feb 20 20:41:08 2008 +0100
+
+    More accurate error messages on device open fail.
+    
+    The message "cannot open input pEvdev" resulted in a lot of bug reports of confused users that did not
+    supply a device path. Now we tell them when it is missing or print out a reason when device open fails.
+
+commit 8ae4d17ca3fb9ec06b16df5c737cd9021453a020
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Tue Feb 19 22:49:51 2008 +0100
+
+    Let kernel autorepeat pass when set on default values
+    
+    xorg-server won't generate soft autorepeat, when interval/delay are at default of 40/660 (see xkb/ddxCtrls.c:
+    XkbDDXUsesSoftRepeat). When we hit the defaults, we let the kernel autorepeat pass, if we differ, we swallow them all
+    and let the server figure out autorepeat in software.
+
+commit 134ce2e493882ce411d17ea97ebb243a7d574144
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Tue Feb 19 21:12:36 2008 +0100
+
+    Set repeat_delay and repeat_interval to default values
+    
+    Set ctrls->repeat_delay and ctrls->repeat_interval so that keys will be automatically repeated in software.
+
+commit 10e7c3fbdf4e94c212c0807844721064e7490729
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Tue Feb 19 21:09:13 2008 +0100
+
+    Filter all incoming repeated key events
+    
+    Not just filter modifiers but every repeated key, because the software implementation will take care of what key to
+    repeat and what not. Otherwise the kernel's autorepeated keys interfere with the software generated ones.
+
+commit f766404fd94851ea8b3cedc5c7336a5524b7a7ae
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Tue Feb 19 21:05:49 2008 +0100
+
+    Don't inform kernel evdev driver about autorepeat change
+    
+    We do autorepeat in software now. Informing the kernel would change the autorepeat speed on virtual terminals, which is
+    probably not wanted so we leave the settings untouched.
+
+commit d032d3c8b40e152cc0fd8409f910f23559873aaf
+Author: Vinay Bondhugula <vinayb@vmware.com>
+Date:   Tue Jan 29 22:15:22 2008 -0800
+
+    Clear EV_ABS_V_USE_TOUCH for devices without a touch button
+    
+    VMware's absolute pointing device does not have a pressure/touch button.
+    Although evdev correctly recognizes this, it sets "use_touch" for X and Y axes
+    regardless of the touch button. This patch clears the USE_TOUCH flag for the X
+    and Y axes if the device does not have a touch button.
+
+commit 5adbc6b98ca1da9a426528ce0df64a992feff3bd
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Tue Jan 29 14:07:49 2008 +1030
+
+    Initialise b_map_data to correct size. Bug #13991
+    
+    X.Org Bug 13991 <http://bugs.freedesktop.org/show_bug.cgi?id=13991>
+
+commit eeb3727004327bc4d83192a7956c1835b3bd6161
+Author: Julien Cristau <jcristau@debian.org>
+Date:   Fri Nov 9 00:38:54 2007 +0100
+
+    Don't flush buttons on init (bug#12630)
+
+commit fa15e909933252d5cc0a2a272506effbcf21d6f9
+Author: Peter Samuelson <peter@p12n.org>
+Date:   Thu Oct 11 07:27:30 2007 +0200
+
+    Fix one additional typo in evdev.man (axis named BRAKE, not BREAK).
+
+commit 12a27693b9bb41b9222c5c2256815d225ee75929
+Author: Peter Samuelson <peter@p12n.org>
+Date:   Thu Oct 11 00:09:40 2007 +0200
+
+    evdev.man minor fixes
+    
+    * Use \- (ASCII dash) instead of - (hyphen), where appropriate
+    * Use a roff escape instead of a UTF-8 character.
+    * Consistent use of quote characters.
+    * Consistent use of typographic conventions:
+      italic "n" in place of "<N>" or "integer" or "number",
+      bold for option names, bit maps, etc.
+    
+    Debian bug #446118
+
+commit 1c40c7db188bc9030aaf256004b914815e821940
+Author: James Cloos <cloos@jhcloos.com>
+Date:   Mon Sep 3 05:52:08 2007 -0400
+
+    Add *~ to .gitignore to skip patch/emacs droppings
+
+commit e2be2ffa473583b98b93a319163bb54eb5d83ed6
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Wed Aug 1 00:02:33 2007 +0300
+
+    Options: Accept differently-named options
+    
+    Take some differently-named options for device and the XKB options.  These
+    should really be better-handled, but eh.
+
+commit e86aab93c56ad72f3798169ea94dc6b91dab6ab6
+Author: Brice Goglin <Brice.Goglin@ens-lyon.org>
+Date:   Thu Jul 26 18:31:58 2007 +0200
+
+    Multiple typos in evdev.man
+    
+    Reported by "A. Costa" <agcosta@gis.net> in
+    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=432063
+
+commit c69f4bd5707093a4f998c3fad508f466edbe8334
+Author: Tiago Vignatti <vignatti@c3sl.ufpr.br>
+Date:   Fri Jun 15 01:35:29 2007 -0300
+
+    Clean up a little bit the code.
+
+commit 64677ecc76d6eae530960b714712921e1bb9d4a7
+Author: Tiago Vignatti <vignatti@c3sl.ufpr.br>
+Date:   Fri Jun 15 01:33:49 2007 -0300
+
+    Remove inotify things.
+
+commit 08a09682f5b6d43181e98bc72782e2b2eec180e5
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Wed Jun 13 11:05:07 2007 -0400
+
+    Update version using PACKAGE_VERSION_*.
+
+commit 9c9a47210a6c7146f29fd6d05b6f46955a3bee5a
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Jun 12 11:59:16 2007 -0400
+
+    Move the mode option handling to the Init stage.
+    (Sorta ugly placement wise, but the other segfaults.)
+
+commit 2d2c4804f925505e737c2c812687f47840218c93
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Mon Jun 11 09:08:24 2007 -0400
+
+    evdev.c:
+    
+        Set and use the X mode control, letting XInput see it properly.
+    
+        Kill some cruft.
+    
+    evdev.h:
+    
+        Set and use the X mode control, letting XInput see it properly.
+    
+    evdev_axes.c:
+    
+        Set and use the X mode control, letting XInput see it properly.
+    
+    evdev_key.c:
+    
+        Remove some cruft, the bell func can be NULL now, so do so.
+    
+        Don't bother looking for keys above 0xF7 until we can actually do
+        something with them.
+
+commit 6b97bf7a4eaa34ebde4ac7250f660da5bab8164d
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Wed Jun 6 05:00:29 2007 -0400
+
+    Handle default remapping around existing button targets better.
+
+commit 5c6b3dd86feef58ccf43a710624404031df72f2c
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Wed Jun 6 04:42:51 2007 -0400
+
+    Move MapButtons_t closer to where it's used.
+
+commit f15636ac529481a9d83e0250ff89690296f96a3d
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Wed Jun 6 04:41:54 2007 -0400
+
+    Wheel mice work again!
+    (Old configs don't.)
+    
+    evdev.c:
+    
+        Add EvdevParseMapToButton and EvdevParseMapToButtons to evdev_map_parsers.
+    
+        Add EvdevParseMapOption to search through evdev_map_parsers.
+    
+        Fix up EvdevTokenize to handle the evdev_option_token_t changes.
+    
+        EvdevAxesNew0 after BtnNew0 instead of before now.
+        (This isn't the right fix.)
+    
+    evdev.h:
+    
+        EVDEV_MAXBUTTONS -> BTN_MAX.
+    
+        Redid evdevBtnRec with the new mapping goodness.
+    
+        Removed v_min and v_max from evdevAbsRec.
+    
+        Reworked evdev_option_token_t, no union, no is_chain.
+        If it's a chain, it still has a string, but the chain pointer is set.
+    
+        EvdevParseMapToButton, EvdevParseMapToButtons, and EvdevParseMapOption.
+    
+    evdev_axes.c:
+    
+        Kill off EvdevAxesMapButton, a variant lives in evdev_btn.c now.
+    
+        Changes for the evdev_option_token_t changes.
+    
+        Use EvdevParseMapOption instead of repeating the contents twice.
+    
+        Disable EV_ABS_V_INVERT for the moment. (Better fix maybe needed.)
+    
+    evdev_btn.c:
+    
+        s/Ptr /Rec */g
+    
+        EvdevMapButton and parser.
+    
+        EvdevMapButtons and parser.
+    
+        Nuke EvdevBtnCalcRemap as a whole.
+    
+        Move everything but the alloc to New1 from New0.
+    
+        New mapping code, same guts os the axes mapping code even.
+
+commit 276685fa1dfc7c2d78178173545df3e28bc82544
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Jun 5 23:55:50 2007 -0400
+
+    Fix REL mode.
+    
+    Make buttons mostly work again. (Short term fix.)
+    
+    NOTE: Wheel to button remapping is still missing!
+
+commit 27a86f81683794c1f7cd3bc6d474898ff69a7b6e
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Jun 5 23:19:59 2007 -0400
+
+    Update the copyright notices for me to include 2007.
+    
+    Finish merging copyright notices. (evdev_key.c was missed.)
+
+commit 26dbf38041ebe67e7ab399a6746684a404ea2121
+Merge: 2943558 9eb546e
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Jun 5 23:14:46 2007 -0400
+
+    Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-input-evdev
+    
+    Conflicts:
+    
+       src/evdev.h
+
+commit 294355842ba9fb3cb3bbd7bfd60c9ca3ce704475
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Jun 5 23:12:58 2007 -0400
+
+    Alright, this is a really big commit that breaks stuff.
+    
+    evdev.h:
+    
+        Switch to flags in the abs and rel structs.
+    
+        Add the axes struct, and defines.
+    
+        Rework the abs and rel structs, moving stuff to the axes struct and moving
+        everything to the new mapping handling.
+    
+        Add the structs and function declarations for the new tokenization stuff,
+        parsing stuff, and mapping stuff.
+    
+    evdev.c: Add EvdevTokenize, and the evdev_map_parsers list.
+    
+    evdev_axes.c:
+    
+        Basicly a full rewrite, big, messy.
+    
+        We now use a completely different mapping setup for axes, and mapping to
+        buttons is currently missing.
+    
+        However we now handle ABS_CALIB and ABS_AREA, including rotation in both
+        rel and abs modes.
+    
+    evdev_btn.c:
+    
+        Disable lots of code and break things horribly, we compile but we don't
+        work very well.
+    
+        Fixing this is next on my todo list.
+
+commit 9eb546e0e00be30ac6e767b196b17651df2e3d96
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Tue Jun 5 18:26:07 2007 -0400
+
+    Fix header file #ifdef guard.
+
+commit daf926081d1524a8d4980578d5254c42c2791462
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Tue Jun 5 18:24:33 2007 -0400
+
+    Merge copyright notices.
+
+commit c22c955c482df9a7645662023b6d1cf0f33aff15
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Tue Apr 24 23:20:43 2007 +0930
+
+    Disable and remove the device when a read error occurs.
+
+commit f87c44b90cb48a846160b16ff910545f5a659d15
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Apr 24 07:44:26 2007 -0400
+
+    Try harder to make unplugging work.
+
+commit 23309b334c1fe892f7afa735d04569e210497dc3
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Apr 24 07:34:53 2007 -0400
+
+    Kill some more unused bits.
+
+commit 1716ec88bbc980507aa7afeb133b552f77a91a01
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Apr 24 07:34:25 2007 -0400
+
+    Handle driver removal cleanly, we now xfree everything we Xcalloc.
+    
+    NOTE: Someone needs to check for memory leaks, I'd be willing to bet
+    a fair bit that we've got tons in the mouse and xkb code, but.
+
+commit 246812bfbcd856ac0dea237cdbe252706fe17688
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Apr 24 07:01:54 2007 -0400
+
+    Remove the evil xf86ActivateDevice declaration, don't need it anymore.
+    
+    Fix the crash on device unplug.
+    
+    NOTE: We still don't properly get rid of ourselves.
+
+commit a0ea7363f51ff6c2bb81006b7220b7daa9ee9221
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Apr 24 06:49:11 2007 -0400
+
+    Remove all of evdev_brain.c and all callers.
+    
+    Remove the non-functional 2.4 kernel compiling compatibility.
+    
+    Remove the XInput 1.4+ SendCoreEvents/DontSendCoreEvents define replacements.
+    
+    Remove evdevDriver, some stuff from evdevDevice, all users.
+    
+    NOTE: This WILL BREAK all existing configurations.
+    
+    NOTE: Device read failure segfaults, don't unplug stuff.
+
+commit 3c4a96fbd851e46830fe82570d04e191bae5e8e3
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Apr 24 06:12:14 2007 -0400
+
+    Updated configure to 1.2.0, no changes yet.
+    
+    This branch is the great xserver input-hotplug rewrite, consider it unstable
+    but usable with the 'current' (as of this commit) git xserver.
+    
+    (Once it's more done that is.)
+    
+    NOTE: This branch will _not_ remain source or binary compatable with
+    pre-input-hotplug xservers, you have been warned.
+
+commit ba65c34068a836ae393565a6a8260a4e96709816
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Mon Apr 23 10:08:48 2007 +0930
+
+    Remove driver from list if no device is associated any more.
+    
+    This effectively stops the driver from hotplugging new devices. Devices have
+    to be added with the dbus hotplugging events.
+
+commit 9644a4afbfd8ac4cb51facf0409f73f55743d8a3
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Thu Apr 19 15:40:25 2007 +0930
+
+    Remove direct call to DEVICE_INIT, ActivateDevice() takes care of that.
+
+commit d37ba205bba0be782e3cd02ca7cedb98a304482d
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Thu Apr 19 15:38:26 2007 +0930
+
+    Add some documentation to evdev.c and evdev_brain.c.
+
+commit 9875e2f7f96c6bfc4f01fffc7e1127724bbd0b7d
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Thu Apr 19 11:28:13 2007 +0930
+
+    ActivateDevice() before EnableDevice() in EvdevNew.
+
+commit 6db4a9fb84f828f745202c3fddc58d389fca220b
+Author: Peter Hutterer <peter@cs.unisa.edu.au>
+Date:   Sun Mar 25 15:40:26 2007 +0930
+
+    Key: Remove duplicate of keycode 0x6f, remove index 0xf8 to get a
+    maxKeyCode of 255. This way keycode range is in sync with core keyboard range.
+
+commit a9e87f29ccdadebb0742317bb57d66eaaca4b593
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Wed Mar 21 12:19:48 2007 +0200
+
+    Key: Force maximum keycode to be 255
+    Even though we don't have keycodes for anything above 127, make sure our
+    map always covers up to 255.  This ensures that the keycode range never
+    changes.
+
+commit b4a5a20476f7bc77d54a860d7cdd81c223bdb81f
+Author: Tiago Vignatti <vignatti@c3sl.ufpr.br>
+Date:   Wed Feb 14 19:23:21 2007 -0200
+
+    Fix pointer crossing screen bug. Possibly the others input drivers must update
+    this on the same manner.
+
+commit 24f9e67a8f9729fa7cb10f0479a3be9c16c5d13a
+Author: Philip Langdale <philipl@fido2.homeip.net>
+Date:   Sat Feb 10 22:17:01 2007 -0800
+
+    Stop caching the screen size for scaling.
+    
+    Do be able to correctly scale absolute inputs, the actual
+    screen size must be used as this changes when the screen
+    resizes.
+
+commit d8d8f114caece4c26c777ae6eee57e66b1f499e7
+Author: root <root@agamemnon.b5>
+Date:   Wed Jan 17 19:27:40 2007 -0500
+
+    For reasons related to handling pathological remapping cases, and
+    differences between HID and X, pretend a middle button exists
+    whenever a right button exists.
+
+commit ebb30a554fe084a50c7281defea80c38bc1b0ddd
+Author: root <root@agamemnon.b5>
+Date:   Sat Jan 13 07:33:49 2007 -0500
+
+    Fix a bug where we potentially wrote garbage events when LEDs change.
+    
+    Support setting keyboard repeat rate/period.
+
+commit 3d8bb262e42b1c5442aebb4048c71b4dc8ce24a0
+Author: root <root@agamemnon.b5>
+Date:   Thu Jan 11 22:42:19 2007 -0500
+
+    Handle swapping of right and middle buttons better in some odder cases.
+
+commit 987c6b1597f184e035c3ecef15a776f7c64cd4fe
+Author: root <root@agamemnon.b5>
+Date:   Thu Jan 11 22:41:23 2007 -0500
+
+    No more call to xf86OSRingBell in any cases,
+     maybe do some conditional stuff later.
+
+commit 8155e49e76aa2d1d953fb71ead6a5c3110f3d80c
+Author: root <root@agamemnon.b5>
+Date:   Mon Jan 8 08:59:44 2007 -0500
+
+    Pad out button_names so we can loop over things more sanely.
+    
+    Support for ignoring the existance of buttons,
+    and for not telling X about them.
+    
+    By default don't tell X about tools and touch as buttons.
+    TODO: Revisit this choice later.
+
+commit e1fe72e7fe663a479a5be1b5e16ecbba52f511a8
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Sat Dec 16 01:42:18 2006 +0200
+
+    bump to 1.1.5
+
+commit 9f3be57929048950ad0e03cfef44b5336c38aab3
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Wed Dec 6 18:50:15 2006 +0200
+
+    Makefile.am: make ChangeLog hook safer
+    Make ChangeLog hook as safe as possible.
+
+commit 5a5457e69c719980334cb662e5abcb77cd09bc7a
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Thu Nov 2 03:42:57 2006 +0200
+
+    bump to 1.1.4
+
+commit 3fc70342aaba5f95d01b6e51164ae207532fa8f4
+Merge: 1a8cea3 ef01c2e
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Thu Nov 2 03:42:14 2006 +0200
+
+    Merge branch 'input-hotplug'
+
+commit 1a8cea3dc4d8336b61a071a52479e71d7dd619d4
+Merge: 51d21a3 4c72fb7
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Thu Nov 2 03:42:13 2006 +0200
+
+    Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-input-evdev
+
+commit ef01c2ef65fa64cb213dc3adfa30c75635d1fe03
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Thu Nov 2 03:41:48 2006 +0200
+
+    key: use os bell-ringing function
+    Use the OS bell-ringing function to ding the bell.
+
+commit 036b457c1b3f7d2d174da890cb8598d907181f8e
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Wed Oct 25 02:22:46 2006 +0300
+
+    support new DIX motion history API
+    Use the DIX motion history if we have ABI version 1 or higher.
+
+commit 79eb7dcac8cdbecc07be08737388a8a6574e3d76
+Merge: d7f686b 63f7edf
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Tue Oct 17 11:32:39 2006 +0300
+
+    Merge branch 'input-hotplug' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-input-evdev into input-hotplug
+
+commit d7f686bfa3e773cfc7740c707da9fc64196e143c
+Merge: ec09e0d 4c72fb7
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Tue Oct 17 11:31:58 2006 +0300
+
+    Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-input-evdev into input-hotplug
+
+commit ec09e0d55dd14164cc46a68a71d439cc550df063
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Sun Oct 15 19:37:46 2006 +0300
+
+    brain: call xf86DeleteInput when removing device
+    Call xf86DeleteInput from evdevRemoveDevice, so it also gets removed from
+    xf86InputDevs in the DDX.
+
+commit 4c72fb7b769b78cfa2b4cc39eb03fdacd2b5039c
+Author: Adam Jackson <ajax@benzedrine.nwnk.net>
+Date:   Fri Oct 13 18:25:10 2006 -0400
+
+    Bump to 1.1.3
+
+commit 77cbbc20b60fd564f8add39bfb840c85d5cad51d
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Sun Oct 8 16:14:12 2006 +0300
+
+    key: remove usage of OS keyboard layer for bell
+    Right now, bell is a no-op.
+
+commit 5c5ef3fbd6eb0b668139df3ff5eda67766e86dcd
+Author: Drew Parsons <dparsons@debian.org>
+Date:   Fri Oct 6 10:56:24 2006 +1000
+
+    m68k support (thanks Geert Uytterhoeven for the inotify codes).
+
+commit a96b048e560782399a98c57cad255df778471ea1
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Mon Oct 2 17:50:55 2006 -0400
+
+    Make some debugging messages optional.
+    
+    Correctly handle emulating relative mode from absolute data in the case where
+    we do not get X and Y data at the same time on touching.
+
+commit d8ea40dc4a78a6197d474d806ac5367dae83655a
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Mon Oct 2 17:49:20 2006 -0400
+
+    Use XORG_VERSION_CURRENT in the module version struct.
+
+commit ab65184d472614d2664e6cd7bca2d6dbc28fad07
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Sun Sep 10 06:47:15 2006 -0400
+
+    Fix compilation.
+
+commit 63f7edf7862032221e25de3c59fee1158d616597
+Merge: 7b91f92 771eee9
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Jul 25 16:00:44 2006 -0400
+
+    Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-input-evdev into input-hotplug
+
+commit 771eee968282e308d997adfa78bd39e7429d2c1c
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Sun Jul 23 22:40:51 2006 -0400
+
+    Replace the old two buffer approach to handling rel emulation of abs axes,
+    should help with some of the reported jitter problems.
+
+commit e4681504487151553894ae0d513b9e833d2597d1
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Fri Jul 21 14:38:12 2006 -0400
+
+    fix InitValuatorClassDeviceStruct call
+    I don't know how the last parameter got there.  Sorry.
+
+commit fa03de438ea0ae0f07424235f4972e73ff88ef17
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Wed Jul 19 23:06:23 2006 -0400
+
+    Move the axis to button map code back into the rel code.
+    
+    This might solve some problems, but should at least prevent some odd behavior.
+
+commit 7b91f9277afb4bd9e557f9600bd92c68dd2435c9
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Wed Jul 19 19:45:27 2006 -0400
+
+    pass maxval correctly to xf86InitValuatorAxisDeviceStruct
+    Pass a maxval of -1 (i.e., fill this in appropriately), rather than 0 (0).
+
+commit 7defeb0aefb216d203b495a53a6d1d505f7dece4
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Wed Jul 19 19:43:08 2006 -0400
+
+    pass number of axes to InitValuatorClassDeviceStruct
+    This is now required with the input-hotplug server.
+
+commit 1cb568c0a6c18ec62ebb89ca21a22a77c78cad24
+Author: Daniel Stone <daniel.stone@nokia.com>
+Date:   Wed Jul 19 19:41:54 2006 -0400
+
+    prune device list on DEVICE_CLOSE
+    Remove a device from the device list when we get DEVICE_CLOSE.
+
+commit dc88668839f4613d60526aa78aed3e74eebe64ad
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Thu Jul 13 11:59:25 2006 -0400
+
+    Split the New functions so that structs can be allocated and buttons
+    detected, and then stuff that depends on _other_ areas.
+    (Specificly, axes and btn have a circular dependency on which one has to
+    run first, this solves that.)
+    
+    Add button names, and a way to get a button number from a name.
+    
+    Add a function for checking to see if a button exists, takes the number from the previous function.
+    
+    Change the (unused) state array of pointers in the button struct to an array of pointers to functions for callback.
+    
+    Implemented the 'touch' feature, on by default if BTN_DIGI_TOUCH exists,
+    won't, in rel mode, process x/y data unless it's down, and is used to
+    try and make 'pick up stencil, move to other side of digitizer, set back
+    down' not jump to the other side of the screen in rel mode.
+    (This doesn't work as well as it could, but I'm fairly sure that it's
+    due to the quality of the absolute input device I'm using, but feedback
+    would be really nice.)
+    
+    FIXME: Update the manpage for this.
+
+commit 090d43acf315283effe8a1c858cac8167ebe4d08
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Jul 11 16:47:15 2006 -0400
+
+    Update the .gitignore files to remove some more noise.
+
+commit 1b9a9599a4df85b0e925086d12bd48626b09bb45
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Jul 11 16:44:43 2006 -0400
+
+    Rename .cvsignore to .gitignore.
+
+commit f7a9c74fbccd79bf406b0afc41237303642b75c2
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Jul 11 16:42:41 2006 -0400
+
+    Grab the ChangeLog generation rule from libX11.
+
+commit 9cb7c3dbad1a4afdb84c338e83f597455022dcdc
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Jul 11 12:48:10 2006 -0400
+
+    (Hope this works.)
+    Remove the ChangeLog file, as the entire contents can be gotten via 'git log'.
+
+commit eba5ea8d5a19f2b1984cbf20c95d22e243f19567
+Author: Zephaniah E. Hull <warp@agamemnon.b5>
+Date:   Tue Jul 11 03:08:30 2006 -0400
+
+    Set pInfo->fd to -1 when we close it in EvdevProc.
+
+commit 51d21a369416bb0a45a2894e83a1cb092cc307d8
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Sun Jul 9 18:08:50 2006 +0100
+
+    remove XFree86LOADER usage
+    Build evdevModuleData, et al, unconditionally.
+
+commit 4645247d45b1653c56d8c99d5685960159e464be
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Thu Jun 22 21:16:44 2006 +0000
+
+    MIPS support. (Joshua Kinard)
+
+commit 57a7f2844108072bf03c9f82baf92e3447d18fbe
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Fri Jun 2 19:39:52 2006 +0000
+
+    Fix an obvious bogon to avoid crashing on absolute axis setup.
+
+commit 1b03250797daa0ac98323a9f43e895dd0b5c7761
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Mon May 15 22:47:23 2006 +0000
+
+    Hopefully fix the bitops stuff to actually _work_.
+
+commit e9c60da89a9c55b81b2dedcf6ee3d1aefb4ff591
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Sun May 14 11:55:50 2006 +0000
+
+    Tweak credits and references.
+    Change the longs to unsigned longs in the bitfields.
+    Cleanup our includes.
+    Stop pulling in asm/types.h and asm/bitops.h.
+    Conditionally define the stuff that used to come from the above, including
+        our own test_bit, set_bit and clear_bit.
+    Change the longs to unsigned longs in the bitfields.
+    Change the longs to unsigned longs in the bitfields.
+    Use the bitop defines in evdev.h properly.
+    Change the longs to unsigned longs in the bitfields.
+    Change the longs to unsigned longs in the bitfields.
+    Use the bitop defines in evdev.h properly.
+    Change the longs to unsigned longs in the bitfields.
+    Use the bitop defines in evdev.h properly.
+    Add HPPA/HPPA64 entries. (Thanks to Fabio M. Di Nitto
+        <fabbione@ubuntu.com>)
+
+commit eca922bd95fbcf09dd0839e571dc30263c94172f
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Sun Apr 30 21:39:08 2006 +0000
+
+    xf86-input-evdev v1.1.2
+    Bugzilla #6734 <https://bugs.freedesktop.org/show_bug.cgi=6734> Apply patch
+        from Philip Langdale which causes us to make sure that O_NONBLOCK is
+        set on the inotify device.
+
+commit f75aadfd628db727e6732c2f0df0c17e75bdeda6
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Sat Apr 15 13:01:36 2006 +0000
+
+    xf86-input-evdev v1.1.1
+
+commit cffc51e04aba0090dfb663d2927117318b5ea00c
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Fri Apr 14 07:01:37 2006 +0000
+
+    evdevAbsRec: Remove the scale bool, rename scale_x and scale_y to scale[2].
+        evdevAxesRec: Make btnMap an int array instead of a Card8 array.
+    Make abs support and non-core stuff actually work.
+    Relative emulation for abs mode is still a bit broken, but that's far less
+        critical.
+    How many buttons we've registered is configuration information, not an
+        error message.
+
+commit c968040cde4e1a7c73332701008f6abfb1fa3ab3
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Sun Apr 9 00:41:42 2006 +0000
+
+    Remove a debugging message.
+    Actually, well, _work_. Note, abs support still segfaults, I'll debug it
+        after I've slept. But I should get it tomorrow.
+
+commit 880879015bf1eec49d374274d644ba015a6a4610
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Sat Apr 8 21:55:17 2006 +0000
+
+    Dropped the xorg-xserver 1.0.99.901 requirement. (Things were tweaked to
+        mostly work for older servers again.)
+    Close the device properly on read errer.
+    Minimal inotify support, not ideal yet, but...
+    Minimal inotify support, not ideal yet, but...
+    Minimal inotify support, not ideal yet, but...
+
+commit c97fdb44493e55f3456222855293016a596ff56e
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Sat Apr 8 17:23:06 2006 +0000
+
+    Remove evdev_abs.c and evdev_rel.c. Added evdev_axes.c.
+    Change the calls to refer to EvdevAxes instead of Abs and Rel. Include
+        mipointer.h. (Fixes a compile error.) Remove an unused variable from
+        EvdevReadInput.
+    Removed evdev_abs.c and evdev_rel.c, added evdev_axes.c. Added count to rel
+        and abs. Moved btnMap from rel to the new axes. Shuffle some includes,
+        and include stdarg.h.
+    Removed.
+    New, a mix of rel and abs that should actually work in the rel case.
+    Rearrange include order. btnMap was moved from being part of rel to being
+        part of axes.
+    Removed.
+    Rearrange include order.
+    Rearrange include order.
+    NOTE: This commit has been compile tested, not run tested.
+    I have some other changes to make before I can do more heavy testing.
+
+commit ad4d62e1d318c629f994883e3b9926627bec16f0
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Fri Apr 7 17:30:27 2006 +0000
+
+    Unlibcwrap. Bump server version requirement. Bump to 1.1.0.
+
+commit e9a6f6d1a0b5cf6f7dc4fb122f6d28cbf3929960
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Fri Mar 31 18:11:52 2006 +0000
+
+    Fix the fd pointer leak reported by primer. (Not the same patch.)
+    Disable the undocumented xkb guts options in the key driver. (Requested by
+        Daniel Stone.)
+
+commit 05b56eeb5c74aebe81de7550c41546d7d6f3fb0c
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Thu Mar 16 13:09:19 2006 +0000
+
+    Switch from my own globbing function to fnmatch.
+    Detect keys numbered higher then buttons. Remove the (depreciated since
+        long before xkb support was added to evdev) XkbKeymap option.
+
+commit a3149dc44a36a46cc117a2fde43ee348a2371304
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Thu Mar 16 13:05:04 2006 +0000
+
+    Update to include all the new device matching options.
+
+commit 9972f2b1c77eefe5fb6a2ba7baacaf6b273228a8
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Mon Feb 27 13:22:35 2006 +0000
+
+    Don't leave keys in the down state when we get turned off. (VT switching,
+        getting unplugged, that sort of stuff.)
+
+commit 94cb4aa1f8caf1ba141ab0839c9eb0b2b5357470
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Mon Feb 27 10:48:40 2006 +0000
+
+    Better error reporting if the read fails.
+    Work properly if we're defining entirely by capability maps.
+
+commit 47482dad76ab74c0b5c9e8d455f04935651173ec
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Fri Feb 24 13:44:56 2006 +0000
+
+    Compile with -Wall now. Add evdev.h to the sources so that make distcheck
+        gets it.
+    Bugzilla #5943 <https://bugs.freedesktop.org/show_bug.cgi=5943> Make sure
+        we include errno.h.
+    Reduce EVDEV_MAXBUTTONS to 96.
+    Split up evdevStateRec into a struct with pointers to new structs for btn,
+        abs, rel, and key.
+    New structure type for handling the device capability bitmaps.
+    Add device bits and struct input_id to evdevDeviceRec.
+    Add matching device bits, struct input_id, and pass number to
+        evdevDriverRec.
+    Prototype for evdevGetBits from evdev_brain.c.
+    Conversion for the evdevStateRec split.
+    Remove the errno.h include, it's in evdev.h for now.
+    Move the bit getting from the drivers to here, into evdevDeviceRec.
+    Fix a rare case of fd leakage.
+    Add several new (and somewhat ugly) device matching options: <map>Bits:
+        Where map is one of ev, key, rel, abs, msc, led, snd, or ff. In the
+        format of '+0 +3 -1-2 ~5-10', 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. bustype, vendor, product, and version: Simple integer options
+        for matching the struct device_id fields, must be 0 (the default) or
+        the exact value you wish to match against. pass: Bounded to 0-3,
+        devices are matched to the first matching entry found, order for
+        multiple matching entries in the same pass is undefined, but it starts
+        with pass 0 and goes to pass 3.
+    Adaptation for the evdevStateRec split and the change in capability bitmap
+        handling.
+    Add evdevGetBits to fill the new evdevBitsRec struct type.
+    Lots of somewhat ugly code for matching by capability bits.
+    Split out of evdevRescanDevices to smaller handling functions. The new
+        design should be better if I decide to handle arbitrary Device fields
+        again.
+    Adaptation for the evdevStateRec split and the change in capability bitmap
+        handling.
+    Handle all buttons, no button compression at this time, however we reorder
+        things so that BTN_MOUSE comes before BTN_MISC, somewhat evily.
+    Support for the new btn->state[] array of int pointers.
+    Adaptation for the evdevStateRec split and the change in capability bitmap
+        handling.
+    Adaptation for the evdevStateRec split and the change in capability bitmap
+        handling.
+    I really hope I didn't miss any changes.
+
+commit 739a0f51b07bd3fdccc156358bf9fca302477042
+Author: Lars Knoll <lars@trolltech.com>
+Date:   Fri Feb 24 12:14:32 2006 +0000
+
+    include errno.h to make it compile.
+
+commit 763edd37305e789bcc31746e5ea41f4df9d0b2a4
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Mon Feb 20 09:18:56 2006 +0000
+
+    Bugzilla #5950 <https://bugs.freedesktop.org/show_bug.cgi=5950> Possible
+        (maybe) fix for bug #5950. Though, I'm not convinced and still don't
+        see how this bug could be happening, especially if this doesn't do it.
+
+commit c6dbf89d9d40fcbce72493404ea02b7e7957513f
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Sun Feb 19 19:11:04 2006 +0000
+
+    Add bell support.
+
+commit 28ee08ef0810ad48c612280838be3e952c41971d
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Fri Feb 17 01:17:41 2006 +0000
+
+    Bugzilla #5914 <https://bugs.freedesktop.org/show_bug.cgi?id=5914> Stupid
+        little bug, properly handle wheels on 3 button mice.
+
+commit e7d4e6b11eb4cc026e91fd561fda24d9cf19adc4
+Author: Zephaniah E. Hull <warp@aehallh.com>
+Date:   Tue Feb 14 14:57:37 2006 +0000
+
+    Bugzilla #5696 <https://bugs.freedesktop.org/show_bug.cgi?id=5696> Slightly
+        updated version of the patch listed. Basicly a rewrite of the driver,
+        with a few pieces of the old. XKB support, proper device matching,
+        basic absolute pointer support. Lots more, will require some user
+        config changes.
+
+commit edbe44da9ae05469d28502af585cd2259d57d104
+Author: gravity <gravity>
+Date:   Mon Jan 9 05:19:26 2006 +0000
+
+    Add evdev manpage
+
+commit 6808674886a13c866bfeeb3ca5f3b8db72e3d5ca
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Dec 21 02:29:56 2005 +0000
+
+    Update package version for X11R7 release.
+
+commit 5ae3abc1b3fda25d60a207c08b510c3a4f8c0148
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Dec 19 16:25:50 2005 +0000
+
+    Stub COPYING files
+
+commit c58133445ee112901ea69023cac7afb3ca8d8064
+Author: Kevin E Martin <kem@kem.org>
+Date:   Thu Dec 15 00:24:14 2005 +0000
+
+    Update package version number for final X11R7 release candidate.
+
+commit b82e57a082662311cc47abbfc6a15b358be539d6
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Dec 6 22:48:29 2005 +0000
+
+    Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
+
+commit f56f4462f605348f90387308c028f622a5585231
+Author: Kevin E Martin <kem@kem.org>
+Date:   Sat Dec 3 05:49:30 2005 +0000
+
+    Update package version number for X11R7 RC3 release.
+
+commit 36fc29d0103707676b3d1ddfb3700457812779f8
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Dec 2 02:16:05 2005 +0000
+
+    Remove extraneous AC_MSG_RESULT.
+
+commit 27690c112a2a890e7b556e51bbc5a42864671fc4
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Tue Nov 29 23:29:55 2005 +0000
+
+    Only build dlloader modules by default.
+
+commit a8ca6bc2d461288928f8ec907fb3dd40dc1642ca
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Nov 28 22:04:06 2005 +0000
+
+    Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4
+        update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir)
+
+commit 753e3320afd033122c9186382866ad8334bc7b7f
+Author: Eric Anholt <anholt@freebsd.org>
+Date:   Mon Nov 21 10:49:03 2005 +0000
+
+    Add .cvsignores for drivers.
+
+commit abcef337586d3862323ea5f77803a369d28aa90b
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Nov 9 21:15:11 2005 +0000
+
+    Update package version number for X11R7 RC2 release.
+
+commit e7fa7d71e5c341027b6bfe47d8c6356d6ed7e92e
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Nov 1 15:08:49 2005 +0000
+
+    Update pkgcheck depedencies to work with separate build roots.
+
+commit f8c131fff1a2adcb772aa5808559e93df2d442c3
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Oct 19 02:48:00 2005 +0000
+
+    Update package version number for RC1 release.
+
+commit b543623997a1a7eda5c681bd431778e0a8da1347
+Author: Kevin E Martin <kem@kem.org>
+Date:   Tue Oct 18 15:46:36 2005 +0000
+
+    Do the following to make the drivers pass distcheck:
+    - Only define EXTRA_DIST when there are actually man pages to be processed
+    - Add missing man pages to keyboard and ati drivers EXTRA_DIST
+
+commit efcacda000e3020cf1c5348aec8e19f68f268a4b
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Tue Oct 18 00:01:51 2005 +0000
+
+    Use @DRIVER_MAN_SUFFIX@ instead of $(DRIVER_MAN_SUFFIX) in macro
+        substitutions to work better with BSD make
+
+commit 1d4cfdd373207d685c89e240c611a0197bce18ec
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Oct 17 22:57:27 2005 +0000
+
+    More 1.7 braindamage: define EXTRA_DIST in terms of @DRIVER_NAME@ instead
+        of indirectly
+
+commit ae0f10570960fc87c566d9084c7a3e78b05ce5ce
+Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
+Date:   Mon Oct 17 00:08:55 2005 +0000
+
+    Use sed & cpp to substitute variables in driver man pages
+
+commit ce0cafa1151841b46dedce616472cf5f38ffde83
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Fri Sep 23 22:32:23 2005 +0000
+
+    Bug #3913: Suppress kernel-generated repeat events for chording keys.
+
+commit 7d5839eb992e0a217b8368762cab80fa7a15faa2
+Author: Daniel Stone <daniel@fooishbar.org>
+Date:   Thu Aug 18 09:03:38 2005 +0000
+
+    Update autogen.sh to one that does objdir != srcdir.
+
+commit 88befc6f4b58a0353984a85a46c0107c8a3a4067
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Date:   Wed Aug 10 14:07:22 2005 +0000
+
+    Don\'t lose existing CFLAGS in all the input drivers and some of the video
+        drivers
+
+commit 8c4fcc1acdbd9e27e8e039c333f5abf77f81e6cf
+Author: Kevin E Martin <kem@kem.org>
+Date:   Fri Jul 29 21:22:40 2005 +0000
+
+    Various changes preparing packages for RC0:
+    - Verify and update package version numbers as needed
+    - Implement versioning scheme
+    - Change bug address to point to bugzilla bug entry form
+    - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to
+        reenable it)
+    - Fix makedepend to use pkgconfig and pass distcheck
+    - Update build script to build macros first
+    - Update modular Xorg version
+
+commit b446f59cc56494f1d3052c587ab9e3bfee89cd48
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Thu Jul 28 01:48:14 2005 +0000
+
+    Yet more 2.4 build fixes, this time for BTN_TASK.
+
+commit f745d59b6c03aec59b5f4c8d0f279296270f0b72
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Mon Jul 25 16:07:34 2005 +0000
+
+    Handle BTN_TASK too (#3859).
+
+commit 0656b4a517b41c047830553d412bc2575f537d46
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Jul 13 20:03:21 2005 +0000
+
+    Make the module dir configurable
+
+commit d1dd2dfe4d49cae4b813c83301b3bddadd704e85
+Author: Kevin E Martin <kem@kem.org>
+Date:   Wed Jul 13 02:20:59 2005 +0000
+
+    Update all input drivers to pass distcheck
+
+commit 29621860ab38f318d8b19551391ac7997b8af2de
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Tue Jul 12 06:15:08 2005 +0000
+
+    Build skeletons for input drivers. Should basically work.
+
+commit 74021126a6e5e9075025911cb9c0b5273f70fda2
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Mon Jul 11 02:37:59 2005 +0000
+
+    Prep input drivers for modularizing by adding guarded #include "config.h"
+
+commit 672f8cd6616cd8cf97e9d01b4c408d9c59f09a7f
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Sun Jul 3 00:06:01 2005 +0000
+
+    Add some build compatibility for 2.6 linux systems with 2.4 kernel headers
+        installed. Allow the use of evdev for mice on 2.4 kernels.
+
+commit 0145e216a7321011dc3bef7f9a0833ffbb61b953
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Sat Jun 25 21:17:01 2005 +0000
+
+    Bug #3626: _X_EXPORT tags for video and input drivers.
+
+commit df1b2f476dde1f6cbc13e9731d772a42baf97adb
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Wed May 11 00:13:15 2005 +0000
+
+    Bug #968: Grab the event device used by the evdev driver to avoid weird
+        issues when input goes to multiple places. Restrict building the evdev
+        driver to 2.6 kernels since EVIOCGRAB didn't exist in 2.4.
+
+commit 319e1b28a37c3b5511f0cf8ab627f9e4f0924634
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Tue Jan 18 20:18:09 2005 +0000
+
+    Handle horizontal wheel events and move mapping of extra buttons up so they
+        don't overlap the wheel buttons. Patch from Alan Swanson (#968).
+
+commit 4ada85ef11c56d5d998a4187d5ed1c557b7098bd
+Author: Adam Jackson <ajax@nwnk.net>
+Date:   Fri Jan 14 17:14:07 2005 +0000
+
+    Build fixes for static server.
+
+commit bdd94f37b31f78ebd2b13e7d263e8ee0dbbb0fb3
+Author: Kristian Høgsberg <krh@redhat.com>
+Date:   Wed Jan 12 20:15:52 2005 +0000
+
+    Add new evdev input driver. This driver uses the linux input layer directly
+        and can handle both mice and keyboards.
+    Convert this to UTF-8 again. The ChangeLog should be kept in UTF-8.
diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..8b82ade
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,291 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..00c7940
--- /dev/null
@@ -0,0 +1,40 @@
+#  Copyright 2005 Adam Jackson.
+#
+#  Permission is hereby granted, free of charge, to any person obtaining a
+#  copy of this software and associated documentation files (the "Software"),
+#  to deal in the Software without restriction, including without limitation
+#  on the rights to use, copy, modify, merge, publish, distribute, sub
+#  license, and/or sell copies of the Software, and to permit persons to whom
+#  the Software is furnished to do so, subject to the following conditions:
+#
+#  The above copyright notice and this permission notice (including the next
+#  paragraph) shall be included in all copies or substantial portions of the
+#  Software.
+#
+#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+# Provide an sdk location that is writable by the evdev module
+DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg'
+
+SUBDIRS = src man include
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = xorg-evdev.pc
+
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+       $(INSTALL_CMD)
+
+ChangeLog:
+       $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/README b/README
new file mode 100644 (file)
index 0000000..95873ba
--- /dev/null
+++ b/README
@@ -0,0 +1,20 @@
+xf86-input-evdev - Generic Linux input driver for the Xorg X server
+
+Please submit bugs & patches to the Xorg bugzilla:
+
+        https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
+
+All questions regarding this software should be directed at the
+Xorg mailing list:
+
+        http://lists.freedesktop.org/mailman/listinfo/xorg
+
+The master development code repository can be found at:
+
+        git://anongit.freedesktop.org/git/xorg/driver/xf86-input-evdev
+
+        http://cgit.freedesktop.org/xorg/driver/xf86-input-evdev
+
+For more information on the git code manager, see:
+
+        http://wiki.x.org/wiki/GitPage
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..218197d
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+
+autoreconf -v --install || exit 1
+cd $ORIGDIR || exit $?
+
+#$srcdir/configure --enable-maintainer-mode "$@"
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..dff2bcf
--- /dev/null
@@ -0,0 +1,87 @@
+#  Copyright 2005 Adam Jackson.
+#
+#  Permission is hereby granted, free of charge, to any person obtaining a
+#  copy of this software and associated documentation files (the "Software"),
+#  to deal in the Software without restriction, including without limitation
+#  on the rights to use, copy, modify, merge, publish, distribute, sub
+#  license, and/or sell copies of the Software, and to permit persons to whom
+#  the Software is furnished to do so, subject to the following conditions:
+#
+#  The above copyright notice and this permission notice (including the next
+#  paragraph) shall be included in all copies or substantial portions of the
+#  Software.
+#
+#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Process this file with autoconf to produce a configure script
+
+# Initialize Autoconf
+AC_PREREQ([2.60])
+AC_INIT([xf86-input-evdev],
+        [2.7.0],
+        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
+        [xf86-input-evdev])
+AC_CONFIG_SRCDIR([Makefile.am])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_AUX_DIR(.)
+
+# Initialize Automake
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+# Initialize libtool
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+
+# Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
+m4_ifndef([XORG_MACROS_VERSION], 
+          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
+XORG_DEFAULT_OPTIONS
+
+# Obtain compiler/linker options from server and required extensions
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto inputproto)
+PKG_CHECK_MODULES(UDEV, libudev)
+
+PKG_CHECK_MODULES(XI22, [inputproto >= 2.1.99.3] [xorg-server >= 1.11.99.901], HAVE_XI22="yes", HAVE_XI22="no")
+
+if test "x$HAVE_XI22" = xyes; then
+        # Obtain compiler/linker options for mtdev
+        PKG_CHECK_MODULES(MTDEV, mtdev, HAVE_MTDEV="yes", HAVE_MTDEV="no")
+fi
+if test "x$HAVE_XI22" = xyes && test "x$HAVE_MTDEV" = xyes; then
+        AC_DEFINE(MULTITOUCH, 1, [XI2.2 available])
+fi
+
+# Define a configure option for an alternate input module directory
+AC_ARG_WITH(xorg-module-dir,
+            AC_HELP_STRING([--with-xorg-module-dir=DIR],
+                           [Default xorg module directory [[default=$libdir/xorg/modules]]]),
+            [moduledir="$withval"],
+            [moduledir="$libdir/xorg/modules"])
+inputdir=${moduledir}/input
+AC_SUBST(inputdir)
+
+# X Server SDK location is required to install evdev header files
+# This location is also relayed in the xorg-evdev.pc file
+sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
+
+# Workaround overriding sdkdir to be able to create a tarball when user has no
+# write permission in sdkdir. See DISTCHECK_CONFIGURE_FLAGS in Makefile.am
+AC_ARG_WITH([sdkdir], [], [sdkdir="$withval"])
+AC_SUBST([sdkdir])
+
+DRIVER_NAME=evdev
+AC_SUBST([DRIVER_NAME])
+
+AC_CONFIG_FILES([Makefile
+                 src/Makefile
+                 man/Makefile
+                 include/Makefile
+                 xorg-evdev.pc])
+AC_OUTPUT
diff --git a/include/Makefile.am b/include/Makefile.am
new file mode 100644 (file)
index 0000000..0e3fc1b
--- /dev/null
@@ -0,0 +1 @@
+sdk_HEADERS = evdev-properties.h
diff --git a/include/evdev-properties.h b/include/evdev-properties.h
new file mode 100755 (executable)
index 0000000..c9ebacf
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of Red Hat
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.  Red
+ * Hat makes no representations about the suitability of this software
+ * for any purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors:
+ *     Peter Hutterer (peter.hutterer@redhat.com)
+ */
+
+
+#ifndef _EVDEV_PROPERTIES_H_
+#define _EVDEV_PROPERTIES_H_
+
+/* Middle mouse button emulation */
+/* BOOL */
+#define EVDEV_PROP_MIDBUTTON "Evdev Middle Button Emulation"
+/* CARD32 */
+#define EVDEV_PROP_MIDBUTTON_TIMEOUT "Evdev Middle Button Timeout"
+
+/* Wheel emulation */
+/* BOOL */
+#define EVDEV_PROP_WHEEL "Evdev Wheel Emulation"
+/* CARD8, 4 values [x up, x down, y up, y down], 0 to disable a value*/
+#define EVDEV_PROP_WHEEL_AXES "Evdev Wheel Emulation Axes"
+/* CARD16 */
+#define EVDEV_PROP_WHEEL_INERTIA "Evdev Wheel Emulation Inertia"
+/* CARD16 */
+#define EVDEV_PROP_WHEEL_TIMEOUT "Evdev Wheel Emulation Timeout"
+/* CARD8, value range 0-32, 0 to always scroll */
+#define EVDEV_PROP_WHEEL_BUTTON "Evdev Wheel Emulation Button"
+
+/* Drag lock */
+/* CARD8, either 1 value or pairs, value range 0-32, 0 to disable a value*/
+#define EVDEV_PROP_DRAGLOCK "Evdev Drag Lock Buttons"
+
+/* Axis inversion */
+/* BOOL, 2 values [x, y], 1 inverts axis */
+#define EVDEV_PROP_INVERT_AXES "Evdev Axis Inversion"
+
+/* Reopen attempts. */
+/* CARD8 */
+#define EVDEV_PROP_REOPEN "Evdev Reopen Attempts" /* OBSOLETE */
+
+/* Run-time calibration */
+/* CARD32, 4 values [minx, maxx, miny, maxy], or no values for unset */
+#define EVDEV_PROP_CALIBRATION "Evdev Axis Calibration"
+
+/* Swap x and y axis. */
+/* BOOL */
+#define EVDEV_PROP_SWAP_AXES "Evdev Axes Swap"
+
+/* BOOL */
+#define EVDEV_PROP_THIRDBUTTON "Evdev Third Button Emulation"
+/* CARD32 */
+#define EVDEV_PROP_THIRDBUTTON_TIMEOUT "Evdev Third Button Emulation Timeout"
+/* CARD8 */
+#define EVDEV_PROP_THIRDBUTTON_BUTTON "Evdev Third Button Emulation Button"
+/* CARD32 */
+#define EVDEV_PROP_THIRDBUTTON_THRESHOLD "Evdev Third Button Emulation Threshold"
+
+/* CARD8, 1 value,
+   This property is initialized on devices that have multimedia keys on the
+   function keys. The value of the property selects the default behaviour
+   for the function keys. The behaviour of the fn key (if any exists) is
+   hardware specific. On some hardware, fn may toggle the other set of
+   functions available on the keys.
+
+   0 send functions keys by default, fn may toggle to multimedia keys
+   1 send multimedia keys by default, fn may toggle to function keys
+*/
+#define EVDEV_PROP_FUNCTION_KEYS "Evdev Function Keys"
+
+#ifdef _F_EVDEV_CONFINE_REGION_
+/* Confine region in which relative and absolute devices can be moved */
+#define EVDEV_PROP_CONFINE_REGION "Evdev Confine Region"
+#endif /* #ifdef _F_EVDEV_CONFINE_REGION_*/
+
+#ifdef _F_TOUCH_TRANSFORM_MATRIX_
+#define EVDEV_PROP_TOUCH_TRANSFORM_MATRIX "Evdev Touch Transform Matrix"
+#endif /* #ifdef _F_TOUCH_TRANSFORM_MATRIX_ */
+
+#endif
diff --git a/man/Makefile.am b/man/Makefile.am
new file mode 100644 (file)
index 0000000..0a7311e
--- /dev/null
@@ -0,0 +1,37 @@
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+# 
+
+drivermandir = $(DRIVER_MAN_DIR)
+
+driverman_PRE = $(DRIVER_NAME).man
+
+driverman_DATA = $(driverman_PRE:man=$(DRIVER_MAN_SUFFIX))
+
+EXTRA_DIST = $(DRIVER_NAME).man
+
+CLEANFILES = $(driverman_DATA)
+
+SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+.man.$(DRIVER_MAN_SUFFIX):
+       $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
diff --git a/man/evdev.man b/man/evdev.man
new file mode 100644 (file)
index 0000000..2709d7a
--- /dev/null
@@ -0,0 +1,267 @@
+.\" shorthand for double quote that works everywhere.
+.ds q \N'34'
+.TH EVDEV __drivermansuffix__ __vendorversion__
+.SH NAME
+evdev \- Generic Linux input driver
+.SH SYNOPSIS
+.nf
+.B "Section \*qInputDevice\*q"
+.BI "  Identifier \*q" devname \*q
+.B  "  Driver \*qevdev\*q"
+.BI "  Option \*qDevice\*q   \*q" devpath \*q
+.BI "  Option \*qEmulate3Buttons\*q     \*q" True \*q
+.BI "  Option \*qEmulate3Timeout\*q     \*q" 50 \*q
+.BI "  Option \*qGrabDevice\*q     \*q" False \*q
+\ \ ...
+.B EndSection
+.fi
+.SH DESCRIPTION
+.B evdev 
+is an __xservername__ input driver for Linux\'s generic event devices.  It
+therefore supports all input devices that the kernel knows about, including
+most mice, keyboards, tablets and touchscreens.
+.B evdev
+is the default driver on the major Linux distributions.
+.PP
+The 
+.B evdev
+driver can serve as both a pointer and a keyboard input device. Multiple
+input devices are supported by multiple instances of this driver, with one
+InputDevice section of your __xconfigfile__ for each input device that will
+use this driver.
+.PP
+It is recommended that
+.B evdev
+devices are configured through the
+.B InputClass
+directive (refer to __xconfigfile__(__filemansuffix__)) instead of manual
+per-device configuration. Devices configured in the
+__xconfigfile__(__filemansuffix__) are not hot-plug capable.
+.PP
+.SH SUPPORTED HARDWARE
+In general, any input device that the kernel has a driver for can be accessed
+through the 
+.B evdev
+driver.  See the Linux kernel documentation for a complete list.
+.PP
+.SH CONFIGURATION DETAILS
+Please refer to __xconfigfile__(__filemansuffix__) for general configuration
+details and for options that can be used with all input drivers.  This
+section only covers configuration details specific to this driver.
+.PP
+The following driver 
+.B Options
+are supported:
+.TP 7
+.BI "Option \*qButtonMapping\*q \*q" string \*q
+Sets the button mapping for this device. The mapping is a space-separated list
+of button mappings that correspond in order to the physical buttons on the
+device (i.e. the first number is the mapping for button 1, etc.). The default
+mapping is "1 2 3 ... 32". A mapping of 0 deactivates the button. Multiple
+buttons can have the same mapping.
+For example, a left-handed mouse with deactivated scroll-wheel would use a
+mapping of "3 2 1 0 0". Invalid mappings are ignored and the default mapping
+is used. Buttons not specified in the user's mapping use the default mapping.
+.TP 7
+.BI "Option \*qDevice\*q \*q" string \*q
+Specifies the device through which the device can be accessed.  This will 
+generally be of the form \*q/dev/input/eventX\*q, where X is some integer.
+The mapping from device node to hardware is system-dependent. Property:
+"Device Node" (read-only).
+.TP 7
+.BI "Option \*qDragLockButtons\*q \*q" "L1 B2 L3 B4" \*q
+Sets \*qdrag lock buttons\*q that simulate holding a button down, so
+that low dexterity people do not have to hold a button down at the
+same time they move a mouse cursor. Button numbers occur in pairs,
+with the lock button number occurring first, followed by the button
+number that is the target of the lock button. Property: "Evdev
+Drag Lock Buttons".
+.TP 7
+.BI "Option \*qDragLockButtons\*q \*q" "M1" \*q
+Sets a \*qmaster drag lock button\*q that acts as a \*qMeta Key\*q
+indicating that the next button pressed is to be
+\*qdrag locked\*q. Property: "Evdev Drag Lock Buttons".
+.TP 7
+.TP 7
+.BI "Option \*qEmulate3Buttons\*q \*q" boolean \*q
+Enable/disable the emulation of the third (middle) mouse button for mice
+which only have two physical buttons.  The third button is emulated by
+pressing both buttons simultaneously.  Default: off. Property: "Evdev Middle
+Button Emulation".
+.TP 7
+.BI "Option \*qEmulate3Timeout\*q \*q" integer \*q
+Sets the timeout (in milliseconds) that the driver waits before deciding
+if two buttons where pressed "simultaneously" when 3 button emulation is
+enabled.  Default: 50. Property: "Evdev Middle Button Timeout".
+.TP 7
+.BI "Option \*qEmulateWheel\*q \*q" boolean \*q
+Enable/disable "wheel" emulation.  Wheel emulation means emulating button
+press/release events when the mouse is moved while a specific real button
+is pressed.  Wheel button events (typically buttons 4 and 5) are
+usually used for scrolling.  Wheel emulation is useful for getting wheel-like
+behaviour with trackballs.  It can also be useful for mice with 4 or
+more buttons but no wheel.  See the description of the
+.BR EmulateWheelButton ,
+.BR EmulateWheelInertia ,
+.BR EmulateWheelTimeout ,
+.BR XAxisMapping ,
+and
+.B YAxisMapping
+options.  Default: off. Property "Evdev Wheel Emulation".
+.TP 7
+.BI "Option \*qEmulateWheelButton\*q \*q" integer \*q
+Specifies which button must be held down to enable wheel emulation mode.
+While this button is down, X and/or Y pointer movement will generate button
+press/release events as specified for the
+.B XAxisMapping
+and
+.B YAxisMapping
+settings. If the button is 0 and
+.BR EmulateWheel
+is on, any motion of the device is converted into wheel events. Default: 4.
+Property: "Evdev Wheel Emulation Button".
+.TP 7
+.BI "Option \*qEmulateWheelInertia\*q \*q" integer \*q
+Specifies how far (in pixels) the pointer must move to generate button
+press/release events in wheel emulation mode.  Default: 10. Property: "Evdev
+Wheel Emulation Inertia".
+.TP 7
+.BI "Option \*qEmulateWheelTimeout\*q \*q" integer \*q
+Specifies the time in milliseconds the
+.BR EmulateWheelButton
+must be pressed before wheel emulation is started. If the
+.BR EmulateWheelButton
+is released before this timeout, the original button press/release event
+is sent.  Default: 200. Property: "Evdev Wheel Emulation Timeout".
+.TP 7
+.BI "Option \*qEmulateThirdButton\*q \*q" boolean \*q
+Enable third button emulation. Third button emulation emits a right button
+event (by default) by pressing and holding the first button. The first
+button must be held down for the configured timeout and must not move more
+than the configured threshold for the emulation to activate. Otherwise, the
+first button event is posted as normal. Default: off.  Property: "Evdev
+Third Button Emulation".
+.TP 7
+.BI "Option \*qEmulateThirdButtonTimeout\*q \*q" integer \*q
+Specifies the timeout in milliseconds between the initial button press and
+the generation of the emulated button event.
+Default: 1000. Property: "Evdev Third Button Emulation Timeout".
+.TP 7
+.BI "Option \*qEmulateThirdButtonButton\*q \*q" integer \*q
+Specifies the physical button number to be emitted if third button emulation
+is triggered.
+Default: 3.  Property: "Evdev Third Button Button".
+.TP 7
+.BI "Option \*qEmulateThirdButtonMoveThreshold\*q \*q" integer \*q
+Specifies the maximum move fuzz in device coordinates for third button
+emulation. If the device moves by more than this threshold before the third
+button emulation is triggered, the emulation is cancelled and a first button
+event is generated as normal.
+Default: 20. Property: "Evdev Third Button Emulation Threshold".
+.TP 7
+.BI "Option \*qGrabDevice\*q \*q" boolean \*q
+Force a grab on the event device. Doing so will ensure that no other driver
+can initialise the same device and it will also stop the device from sending
+events to /dev/kbd or /dev/input/mice. Events from this device will not be
+sent to virtual devices (e.g. rfkill or the Macintosh mouse button emulation).
+Default: disabled.
+.TP 7
+.BI "Option \*qInvertX\*q \*q" Bool \*q
+.TP 7
+.BI "Option \*qInvertY\*q \*q" Bool \*q
+Invert the given axis. Default: off. Property: "Evdev Axis Inversion".
+.TP 7
+.BI "Option \*qIgnoreRelativeAxes\*q \*q" Bool \*q
+.TP 7
+.BI "Option \*qIgnoreAbsoluteAxes\*q \*q" Bool \*q
+Ignore the specified type of axis. Default: unset. The X server cannot deal
+with devices that have both relative and absolute axes. Evdev tries to guess
+wich axes to ignore given the device type and disables absolute axes for
+mice and relative axes for tablets, touchscreens and touchpad. These options
+allow to forcibly disable an axis type. Mouse wheel axes are exempt and will
+work even if relative axes are ignored. No property, this configuration must
+be set in the configuration.
+.br
+If either option is set to False, the driver will not ignore the specified
+axes regardless of the presence of other axes. This may trigger buggy
+behavior and events from this axis are always forwarded. Users are
+discouraged from setting this option.
+.TP 7
+.BI "Option \*qCalibration\*q \*q" "min-x max-x min-y max-y" \*q
+Calibrates the X and Y axes for devices that need to scale to a different
+coordinate system than reported to the X server. This feature is required
+for devices that need to scale to a different coordinate system than
+originally reported by the kernel (e.g. touchscreens). The scaling to the
+custom coordinate system is done in-driver and the X server is unaware of
+the transformation. Property: "Evdev Axis Calibration".
+.TP 7
+.B Option \*qMode\*q \*qRelative\*q\fP|\fP\*qAbsolute\*q
+Sets the mode of the device if device has absolute axes.
+The default value for touchpads is relative, for other absolute.
+This option has no effect on devices without absolute axes.
+.TP 7
+.BI "Option \*qSwapAxes\*q \*q" Bool \*q
+Swap x/y axes. Default: off. Property: "Evdev Axes Swap".
+.TP 7
+.BI "Option \*qXAxisMapping\*q \*q" "N1 N2" \*q
+Specifies which buttons are mapped to motion in the X direction in wheel
+emulation mode.  Button number
+.I N1
+is mapped to the negative X axis motion and button number
+.I N2
+is mapped to the positive X axis motion.  Default: no mapping. Property:
+"Evdev Wheel Emulation Axes".
+.TP 7
+.BI "Option \*qYAxisMapping\*q \*q" "N1 N2" \*q
+Specifies which buttons are mapped to motion in the Y direction in wheel
+emulation mode.  Button number
+.I N1
+is mapped to the negative Y axis motion and button number
+.I N2
+is mapped to the positive Y axis motion.  Default: "4 5". Property:
+"Evdev Wheel Emulation Axes".
+
+.SH SUPPORTED PROPERTIES
+The following properties are provided by the
+.B evdev
+driver.
+.TP 7
+.BI "Evdev Axis Calibration"
+4 32-bit values, order min-x, max-x, min-y, max-y or 0 values to disable
+in-driver axis calibration.
+.TP 7
+.BI "Evdev Axis Inversion"
+2 boolean values (8 bit, 0 or 1), order X, Y. 1 inverts the axis.
+.TP 7
+.BI "Evdev Axes Swap"
+1 boolean value (8 bit, 0 or 1). 1 swaps x/y axes.
+.TP 7
+.BI "Evdev Drag Lock Buttons"
+8-bit. Either 1 value or pairs of values. Value range 0-32, 0 disables a
+value.
+.TP 7
+.BI "Evdev Middle Button Emulation"
+1 boolean value (8 bit, 0 or 1).
+.TP 7
+.BI "Evdev Middle Button Timeout"
+1 16-bit positive value.
+.TP 7
+.BI "Evdev Wheel Emulation"
+1 boolean value (8 bit, 0 or 1).
+.TP 7
+.BI "Evdev Wheel Emulation Axes"
+4 8-bit values, order X up, X down, Y up, Y down. 0 disables a value.
+.TP 7
+.BI "Evdev Wheel Emulation Button"
+1 8-bit value, allowed range 0-32, 0 disables the button.
+.TP 7
+.BI "Evdev Wheel Emulation Inertia"
+1 16-bit positive value.
+.TP 7
+.BI "Evdev Wheel Emulation Timeout"
+1 16-bit positive value.
+
+.SH AUTHORS
+Kristian Høgsberg, Peter Hutterer
+.SH "SEE ALSO"
+__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
diff --git a/packaging/xorg-x11-drv-evdev.spec b/packaging/xorg-x11-drv-evdev.spec
new file mode 100644 (file)
index 0000000..ebb53cf
--- /dev/null
@@ -0,0 +1,64 @@
+#sbs-git:slp/pkgs/xorg/driver/xserver-xorg-input-evdev xserver-xorg-input-evdev 2.3.2 1bd95071427e460187b090bc5ff5a2d880fe156a
+Name:  xorg-x11-drv-evdev
+Summary:    Xorg X11 evdev input driver
+Version: 2.7.3
+Release:    3
+Group:      System/X Hardware Support
+License:    MIT
+URL:        http://www.x.org/
+Source0:    %{name}-%{version}.tar.gz
+#Requires:   xorg-server
+Requires:   xorg-x11-server-Xorg
+BuildRequires:  pkgconfig(xorg-macros)
+BuildRequires:  xorg-x11-server-devel
+#BuildRequires:  pkgconfig(xorg-server)
+BuildRequires:  pkgconfig(xkbfile)
+BuildRequires:  pkgconfig(xproto)
+BuildRequires:  pkgconfig(inputproto)
+BuildRequires:  pkgconfig(xrandr)
+BuildRequires:  pkgconfig(randrproto)
+BuildRequires:  pkgconfig(xextproto)
+BuildRequires:  pkgconfig(resourceproto)
+BuildRequires:  pkgconfig(libudev)
+BuildRequires:  pkgconfig(mtdev)
+Requires:  libudev
+Requires:  mtdev
+
+%description
+The Xorg X11 evdev input driver
+
+
+%package devel
+Summary:    Development files for xorg evdev driver
+Group:      Development/Libraries
+Requires:   %{name} = %{version}-%{release}
+
+%description devel
+This package contains xorg evdev development files
+
+
+%prep
+%setup -q
+
+%build
+%autogen
+%reconfigure --disable-static CFLAGS="$CFLAGS -Wall -g -D_F_EVDEV_CONFINE_REGION_ -D_F_ENABLE_DEVICE_TYPE_PROP_ -D_F_GESTURE_EXTENSION_ -D_F_TOUCH_TRANSFORM_MATRIX_ -D_F_ENABLE_REL_MOVE_STATUS_PROP_ "
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}/usr/share/license
+cp -af COPYING %{buildroot}/usr/share/license/%{name}
+%make_install
+
+%remove_docs
+
+%files
+%defattr(-,root,root,-)
+%(pkg-config xorg-server --variable=moduledir )/input/evdev_drv.so
+/usr/share/license/%{name}
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/xorg/evdev-properties.h
+%{_libdir}/pkgconfig/xorg-evdev.pc
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..cca1b0c
--- /dev/null
@@ -0,0 +1,43 @@
+#  Copyright 2005 Adam Jackson.
+#
+#  Permission is hereby granted, free of charge, to any person obtaining a
+#  copy of this software and associated documentation files (the "Software"),
+#  to deal in the Software without restriction, including without limitation
+#  on the rights to use, copy, modify, merge, publish, distribute, sub
+#  license, and/or sell copies of the Software, and to permit persons to whom
+#  the Software is furnished to do so, subject to the following conditions:
+#
+#  The above copyright notice and this permission notice (including the next
+#  paragraph) shall be included in all copies or substantial portions of the
+#  Software.
+#
+#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
+#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+# this is obnoxious:
+# -module lets us name the module exactly how we want
+# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
+# _ladir passes a dummy rpath to libtool so the thing will actually link
+# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
+
+AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
+AM_CPPFLAGS =-I$(top_srcdir)/include
+
+@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la
+@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version
+@DRIVER_NAME@_drv_la_LIBADD = $(MTDEV_LIBS)
+@DRIVER_NAME@_drv_ladir = @inputdir@
+
+@DRIVER_NAME@_drv_la_SOURCES = @DRIVER_NAME@.c \
+                               @DRIVER_NAME@.h \
+                               emuMB.c \
+                               emuThird.c \
+                               emuWheel.c \
+                               draglock.c \
+                               apple.c
+
diff --git a/src/apple.c b/src/apple.c
new file mode 100644 (file)
index 0000000..8e00a84
--- /dev/null
@@ -0,0 +1,312 @@
+/*
+ * Copyright © 2011 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of Red Hat
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.  Red
+ * Hat makes no representations about the suitability of this software
+ * for any purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors:
+ *     Peter Hutterer (peter.hutterer@redhat.com)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <evdev.h>
+#include <evdev-properties.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <exevents.h>
+#include <xf86.h>
+#include <xf86Xinput.h>
+#include <X11/Xatom.h>
+
+/* Apple-specific controls.
+ *
+ * On Apple keyboards, the multimedia function keys are overlaid with the F
+ * keys. F1 is also BrightnessDown, F10 is Mute, etc. The kernel provides a
+ * tweak to enable/disable this.
+ *
+ * /sys/module/hid_apple/parameters/fnmode
+ *     0 .. keyboard sends Fx keys, fn is disabled
+ *     1 .. keyboard sends multimedia keys, fn sends Fx keys
+ *     2 .. keyboard sends Fx keys, fn sends multimedia keys
+ *
+ * We only handle 1 and 2, don't care about 0. If fnmode is found to be on
+ * 0, we force it to 2 instead.
+ */
+
+/* In this file: fkeymode refers to the evdev-specific enums and parameters,
+ * fnmode refers to the fnmode parameter exposed by the kernel. fnmode is
+ * apple-specific */
+#define FNMODE_PATH "/sys/module/hid_apple/parameters/fnmode"
+
+/* Taken from the kernel */
+#define USB_VENDOR_ID_APPLE                             0x05ac
+#define USB_DEVICE_ID_APPLE_ALU_MINI_ANSI               0x021d
+#define USB_DEVICE_ID_APPLE_ALU_MINI_ISO                0x021e
+#define USB_DEVICE_ID_APPLE_ALU_MINI_JIS                0x021f
+#define USB_DEVICE_ID_APPLE_ALU_ANSI                    0x0220
+#define USB_DEVICE_ID_APPLE_ALU_ISO                     0x0221
+#define USB_DEVICE_ID_APPLE_ALU_JIS                     0x0222
+#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI           0x022c
+#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO            0x022d
+#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS            0x022e
+#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI      0x0239
+#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO       0x023a
+#define USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS       0x023b
+
+static int EvdevAppleGetProperty (DeviceIntPtr dev, Atom property);
+static int EvdevAppleSetProperty(DeviceIntPtr dev, Atom atom,
+                      XIPropertyValuePtr val, BOOL checkonly);
+
+static Atom prop_fkeymode;
+static Bool fnmode_readonly; /* set if we can only read fnmode */
+
+struct product_table
+{
+    unsigned int vendor;
+    unsigned int product;
+} apple_keyboard_table[] = {
+    { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_MINI_ANSI},
+    { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_MINI_ISO},
+    { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_MINI_JIS},
+    { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI},
+    { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO},
+    { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS},
+    { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI},
+    { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO},
+    { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS},
+    { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI},
+    { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO},
+    { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS},
+    { 0, 0}
+};
+
+/**
+ * @return TRUE if the device matches a product in the given product table,
+ *         FALSE otherwise
+ */
+static Bool product_check(const struct product_table *t, int vendor, int product)
+{
+    while (t->vendor)
+    {
+        if (vendor == t->vendor && product == t->product)
+            return TRUE;
+        t++;
+    }
+
+    return FALSE;
+}
+
+/**
+ * @return 0 on success, -1 otherwise (check errno)
+ */
+static int
+set_fnmode(enum fkeymode fkeymode)
+{
+    int fd;
+    char mode;
+    int bytes_written;
+
+    if (fkeymode == FKEYMODE_UNKNOWN)
+    {
+        errno = EINVAL; /* silly you */
+        return -1;
+    }
+
+    fd = open(FNMODE_PATH, O_WRONLY);
+    if (fd < 0)
+        return -1;
+
+    mode = (fkeymode == FKEYMODE_FKEYS) ? '2' : '1';
+
+    bytes_written = write(fd, &mode, 1);
+    close(fd);
+
+    return (bytes_written == 1) ? 0 : -1;
+}
+
+/**
+ * Get the current value of fnmode. If fnmode is found to be on 0, we set it
+ * to 2 in the process. Yes, quite daring, I know. I live on the edge.
+ *
+ * @return The current setting of fnmode or FKEYMODE_UNKNOWN on error (check
+ * errno)
+ */
+static enum fkeymode
+get_fnmode(void)
+{
+    int fd;
+    char retvalue;
+
+    fd = open(FNMODE_PATH, O_RDWR);
+    if (fd < 0 && errno == EACCES)
+    {
+        fnmode_readonly = TRUE;
+        fd = open(FNMODE_PATH, O_RDONLY);
+    }
+
+    if (fd < 0)
+        goto err;
+
+    if (read(fd, &retvalue, 1) != 1)
+        goto err;
+
+    if (retvalue != '0' && retvalue != '1' && retvalue != '2')
+    {
+        xf86Msg(X_ERROR, "Invalid fnmode value: %c\n", retvalue);
+        errno = EINVAL;
+        goto err;
+    }
+
+    close(fd);
+
+    /* we don't want 0, switch to 2 */
+    if (retvalue == '0')
+    {
+        if (fnmode_readonly)
+            xf86Msg(X_WARNING, "fnmode is disabled and read-only. Fn key will"
+                    "not toggle to multimedia keys.\n");
+        else
+            set_fnmode(FKEYMODE_FKEYS);
+    }
+
+
+    return retvalue == '1' ? FKEYMODE_MMKEYS : FKEYMODE_FKEYS;
+
+err:
+    if (fd >= 0)
+        close(fd);
+    return FKEYMODE_UNKNOWN;
+}
+
+/**
+ * Set the property value to fkeymode. If the property doesn't exist,
+ * initialize it.
+ */
+static void set_fkeymode_property(InputInfoPtr pInfo, enum fkeymode fkeymode)
+{
+    DeviceIntPtr dev = pInfo->dev;
+    BOOL init = FALSE;
+    char data;
+
+    switch(fkeymode)
+    {
+        case FKEYMODE_FKEYS: data = 0; break;
+        case FKEYMODE_MMKEYS: data = 1; break;
+        case FKEYMODE_UNKNOWN:
+            xf86IDrvMsg(pInfo, X_ERROR, "Failed to get fnmode (%s)\n", strerror(errno));
+            return;
+    }
+
+    if (!prop_fkeymode) {
+        init = TRUE;
+        prop_fkeymode = MakeAtom(EVDEV_PROP_FUNCTION_KEYS, strlen(EVDEV_PROP_FUNCTION_KEYS), TRUE);
+    }
+
+    /* Don't send an event if we're initializing the property */
+    XIChangeDeviceProperty(dev, prop_fkeymode, XA_INTEGER, 8,
+                           PropModeReplace, 1, &data, !init);
+
+    if (init)
+    {
+        XISetDevicePropertyDeletable(dev, prop_fkeymode, FALSE);
+        XIRegisterPropertyHandler(dev, EvdevAppleSetProperty, EvdevAppleGetProperty, NULL);
+    }
+}
+
+
+/**
+ * Called when a client reads the property state.
+ * Update with current kernel state, it may have changed behind our back.
+ */
+static int
+EvdevAppleGetProperty (DeviceIntPtr dev, Atom property)
+{
+    if (property == prop_fkeymode)
+    {
+        InputInfoPtr pInfo  = dev->public.devicePrivate;
+        EvdevPtr     pEvdev = pInfo->private;
+        enum fkeymode fkeymode;
+
+        fkeymode = get_fnmode();
+        if (fkeymode != pEvdev->fkeymode) {
+            /* set internal copy first, so we don't write to the file in
+             * SetProperty handler */
+            pEvdev->fkeymode = fkeymode;
+            set_fkeymode_property(pInfo, fkeymode);
+        }
+    }
+    return Success;
+}
+
+static int
+EvdevAppleSetProperty(DeviceIntPtr dev, Atom atom,
+                      XIPropertyValuePtr val, BOOL checkonly)
+{
+    InputInfoPtr pInfo  = dev->public.devicePrivate;
+    EvdevPtr pEvdev = pInfo->private;
+
+    if (atom == prop_fkeymode)
+    {
+        CARD8 v = *(CARD8*)val->data;
+
+        if (val->format != 8 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        if (fnmode_readonly)
+            return BadAccess;
+
+        if (v > 1)
+            return BadValue;
+
+        if (!checkonly)
+        {
+            if ((!v && pEvdev->fkeymode != FKEYMODE_FKEYS) ||
+                (v && pEvdev->fkeymode != FKEYMODE_MMKEYS))
+            {
+                pEvdev->fkeymode = v ? FKEYMODE_MMKEYS : FKEYMODE_FKEYS;
+                set_fnmode(pEvdev->fkeymode);
+            }
+        }
+    }
+
+    return Success;
+}
+
+void
+EvdevAppleInitProperty(DeviceIntPtr dev)
+{
+    InputInfoPtr pInfo  = dev->public.devicePrivate;
+    EvdevPtr     pEvdev = pInfo->private;
+    enum fkeymode fkeymode;
+
+    if (!product_check(apple_keyboard_table,
+                       pEvdev->id_vendor, pEvdev->id_product))
+        return;
+
+    fkeymode = get_fnmode();
+    pEvdev->fkeymode = fkeymode;
+    set_fkeymode_property(pInfo, fkeymode);
+}
diff --git a/src/draglock.c b/src/draglock.c
new file mode 100644 (file)
index 0000000..ac9d9c0
--- /dev/null
@@ -0,0 +1,318 @@
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ * Copyright 1993 by David Dawes <dawes@xfree86.org>
+ * Copyright 2002 by SuSE Linux AG, Author: Egbert Eich
+ * Copyright 1994-2002 by The XFree86 Project, Inc.
+ * Copyright 2002 by Paul Elliott
+ * (Ported from xf86-input-mouse, above copyrights taken from there)
+ * Copyright © 2008 University of South Australia
+ * Copyright 2008 by Chris Salch
+ * Copyright 2008 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of the authors
+ * not be used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.  The authors make no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+/* Draglock code */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "evdev.h"
+
+#include <xf86.h>
+#include <xf86Xinput.h>
+#include <X11/Xatom.h>
+#include <exevents.h>
+
+#include <evdev-properties.h>
+
+static Atom prop_dlock     = 0; /* Drag lock buttons. */
+
+void EvdevDragLockLockButton(InputInfoPtr pInfo, unsigned int button);
+
+
+/* Setup and configuration code */
+void
+EvdevDragLockPreInit(InputInfoPtr pInfo)
+{
+    EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+    char *option_string = NULL;
+    int meta_button = 0;
+    int lock_button = 0;
+    char *next_num = NULL;
+    char *end_str = NULL;
+    BOOL pairs = FALSE;
+
+    option_string = xf86CheckStrOption(pInfo->options, "DragLockButtons",NULL);
+
+    if (!option_string)
+        return;
+
+    next_num = option_string;
+
+    /* Loop until we hit the end of our option string */
+    while (next_num != NULL) {
+        lock_button = 0;
+        meta_button = strtol(next_num, &end_str, 10);
+
+        /* check to see if we found anything */
+        if (next_num != end_str) {
+            /* setup for the next number */
+            next_num = end_str;
+        } else {
+            /* we have nothing more to parse, drop out of the loop */
+            next_num = NULL;
+        }
+
+        /* Check for a button to lock if we have a meta button */
+        if (meta_button != 0 && next_num != NULL ) {
+            lock_button = strtol(next_num, &end_str, 10);
+
+            /* check to see if we found anything */
+            if (next_num != end_str) {
+                /* setup for the next number */
+                next_num = end_str;
+            } else {
+                /* we have nothing more to parse, drop out of the loop */
+                next_num = NULL;
+            }
+        }
+
+        /* Ok, let the user know what we found on this look */
+        if (meta_button != 0) {
+            if (lock_button == 0) {
+                if (!pairs) {
+                    /* We only have a meta button */
+                    pEvdev->dragLock.meta = meta_button;
+
+                    xf86IDrvMsg(pInfo, X_CONFIG, "DragLockButtons : "
+                                "%i as meta\n", meta_button);
+                } else {
+                    xf86IDrvMsg(pInfo, X_ERROR, "DragLockButtons : "
+                                "Incomplete pair specifying button pairs %s\n",
+                                option_string);
+                }
+            } else {
+
+                /* Do bounds checking to make sure we don't crash */
+                if ((meta_button <= EVDEV_MAXBUTTONS) && (meta_button >= 0 ) &&
+                    (lock_button <= EVDEV_MAXBUTTONS) && (lock_button >= 0)) {
+
+                    xf86IDrvMsg(pInfo, X_CONFIG,
+                                "DragLockButtons : %i -> %i\n",
+                                meta_button, lock_button);
+
+                    pEvdev->dragLock.lock_pair[meta_button - 1] = lock_button;
+                    pairs=TRUE;
+                } else {
+                    /* Let the user know something was wrong
+                       with this pair of buttons */
+                    xf86IDrvMsg(pInfo, X_CONFIG,"DragLockButtons : "
+                                "Invalid button pair %i -> %i\n",
+                                meta_button, lock_button);
+                }
+            }
+        } else {
+            xf86IDrvMsg(pInfo, X_ERROR, "Found DragLockButtons "
+                        "with invalid lock button string : '%s'\n",
+                        option_string);
+
+            /* This should be the case anyhow, just make sure */
+            next_num = NULL;
+        }
+
+        /* Check for end of string, to avoid annoying error */
+        if (next_num != NULL && *next_num == '\0')
+            next_num = NULL;
+    }
+
+    free(option_string);
+}
+
+/* Updates DragLock button state and fires button event messges */
+void
+EvdevDragLockLockButton(InputInfoPtr pInfo, unsigned int button)
+{
+    EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+    BOOL state = 0;
+
+    /* update button state */
+    state = pEvdev->dragLock.lock_state[button - 1] ? FALSE : TRUE;
+    pEvdev->dragLock.lock_state[button - 1] = state;
+
+    EvdevQueueButtonEvent(pInfo, button, state);
+}
+
+/* Filter button presses looking for either a meta button or the
+ * control of a button pair.
+ *
+ * @param button button number (1 for left, 3 for right)
+ * @param value TRUE if button press, FALSE if release
+ *
+ * @return TRUE if the event was swallowed here, FALSE otherwise.
+ */
+BOOL
+EvdevDragLockFilterEvent(InputInfoPtr pInfo, unsigned int button, int value)
+{
+    EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+
+    if (button == 0)
+        return FALSE;
+
+    /* Do we have a single meta key or
+       several button pairings? */
+    if (pEvdev->dragLock.meta != 0) {
+
+        if (pEvdev->dragLock.meta == button) {
+
+            /* setup up for button lock */
+            if (value)
+                pEvdev->dragLock.meta_state = TRUE;
+
+            return TRUE;
+        } else if (pEvdev->dragLock.meta_state) { /* waiting to lock */
+
+            pEvdev->dragLock.meta_state = FALSE;
+
+            EvdevDragLockLockButton(pInfo, button);
+
+            return TRUE;
+        }
+    } else if (pEvdev->dragLock.lock_pair[button - 1] && value) {
+        /* A meta button in a meta/lock pair was pressed */
+        EvdevDragLockLockButton(pInfo, pEvdev->dragLock.lock_pair[button - 1]);
+        return TRUE;
+    }
+
+    /* Eat events for buttons that are locked */
+    if (pEvdev->dragLock.lock_state[button - 1])
+        return TRUE;
+
+    return FALSE;
+}
+
+/**
+ * Set the drag lock property.
+ * If only one value is supplied, then this is used as the meta button.
+ * If more than one value is supplied, then each value is the drag lock button
+ * for the pair. 0 disables a pair.
+ * i.e. to set bt 3 to draglock button 1, supply 0,0,1
+ */
+static int
+EvdevDragLockSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
+                         BOOL checkonly)
+{
+    InputInfoPtr pInfo  = dev->public.devicePrivate;
+    EvdevPtr     pEvdev = pInfo->private;
+
+    if (atom == prop_dlock)
+    {
+        int i;
+
+        if (val->format != 8 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        /* Don't allow changes while a lock is active */
+        if (pEvdev->dragLock.meta)
+        {
+            if (pEvdev->dragLock.meta_state)
+                return BadAccess;
+        } else
+        {
+            for (i = 0; i < EVDEV_MAXBUTTONS; i++)
+                if (pEvdev->dragLock.lock_state[i])
+                    return BadValue;
+        }
+
+        if (val->size == 0)
+            return BadMatch;
+        else if (val->size == 1)
+        {
+            int meta = *((CARD8*)val->data);
+            if (meta > EVDEV_MAXBUTTONS)
+                return BadValue;
+
+            if (!checkonly)
+            {
+                pEvdev->dragLock.meta = meta;
+                memset(pEvdev->dragLock.lock_pair, 0, sizeof(pEvdev->dragLock.lock_pair));
+            }
+        } else if ((val->size % 2) == 0)
+        {
+            CARD8* vals = (CARD8*)val->data;
+
+            for (i = 0; i < val->size && i < EVDEV_MAXBUTTONS; i++)
+                if (vals[i] > EVDEV_MAXBUTTONS)
+                    return BadValue;
+
+            if (!checkonly)
+            {
+                pEvdev->dragLock.meta = 0;
+                memset(pEvdev->dragLock.lock_pair, 0, sizeof(pEvdev->dragLock.lock_pair));
+
+                for (i = 0; i < val->size && i < EVDEV_MAXBUTTONS; i += 2)
+                    pEvdev->dragLock.lock_pair[vals[i] - 1] = vals[i + 1];
+            }
+        } else
+            return BadMatch;
+    }
+
+    return Success;
+}
+
+/**
+ * Initialise property for drag lock buttons setting.
+ */
+void
+EvdevDragLockInitProperty(DeviceIntPtr dev)
+{
+    InputInfoPtr pInfo  = dev->public.devicePrivate;
+    EvdevPtr     pEvdev = pInfo->private;
+
+    if (!dev->button) /* don't init prop for keyboards */
+        return;
+
+    prop_dlock = MakeAtom(EVDEV_PROP_DRAGLOCK, strlen(EVDEV_PROP_DRAGLOCK), TRUE);
+    if (pEvdev->dragLock.meta)
+    {
+        XIChangeDeviceProperty(dev, prop_dlock, XA_INTEGER, 8,
+                               PropModeReplace, 1, &pEvdev->dragLock.meta,
+                               FALSE);
+    } else {
+        int highest = 0;
+        int i;
+        CARD8 pair[EVDEV_MAXBUTTONS] = {0};
+
+        for (i = 0; i < EVDEV_MAXBUTTONS; i++)
+        {
+            if (pEvdev->dragLock.lock_pair[i])
+                highest = i;
+            pair[i] = pEvdev->dragLock.lock_pair[i];
+        }
+
+        XIChangeDeviceProperty(dev, prop_dlock, XA_INTEGER, 8, PropModeReplace,
+                               highest + 1, pair, FALSE);
+    }
+
+    XISetDevicePropertyDeletable(dev, prop_dlock, FALSE);
+
+    XIRegisterPropertyHandler(dev, EvdevDragLockSetProperty, NULL, NULL);
+}
diff --git a/src/emuMB.c b/src/emuMB.c
new file mode 100644 (file)
index 0000000..eb01495
--- /dev/null
@@ -0,0 +1,391 @@
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ * Copyright 1993 by David Dawes <dawes@xfree86.org>
+ * Copyright 2002 by SuSE Linux AG, Author: Egbert Eich
+ * Copyright 1994-2002 by The XFree86 Project, Inc.
+ * Copyright 2002 by Paul Elliott
+ * (Ported from xf86-input-mouse, above copyrights taken from there)
+ * Copyright © 2008 University of South Australia
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of the authors
+ * not be used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.  The authors make no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+/* Middle mouse button emulation code. */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "evdev.h"
+
+#include <X11/Xatom.h>
+#include <xf86.h>
+#include <xf86Xinput.h>
+#include <exevents.h>
+
+#include <evdev-properties.h>
+
+static Atom prop_mbemu     = 0; /* Middle button emulation on/off property */
+static Atom prop_mbtimeout = 0; /* Middle button timeout property */
+/*
+ * Lets create a simple finite-state machine for 3 button emulation:
+ *
+ * We track buttons 1 and 3 (left and right).  There are 11 states:
+ *   0 ground           - initial state
+ *   1 delayed left     - left pressed, waiting for right
+ *   2 delayed right    - right pressed, waiting for left
+ *   3 pressed middle   - right and left pressed, emulated middle sent
+ *   4 pressed left     - left pressed and sent
+ *   5 pressed right    - right pressed and sent
+ *   6 released left    - left released after emulated middle
+ *   7 released right   - right released after emulated middle
+ *   8 repressed left   - left pressed after released left
+ *   9 repressed right  - right pressed after released right
+ *  10 pressed both     - both pressed, not emulating middle
+ *
+ * At each state, we need handlers for the following events
+ *   0: no buttons down
+ *   1: left button down
+ *   2: right button down
+ *   3: both buttons down
+ *   4: emulate3Timeout passed without a button change
+ * Note that button events are not deltas, they are the set of buttons being
+ * pressed now.  It's possible (ie, mouse hardware does it) to go from (eg)
+ * left down to right down without anything in between, so all cases must be
+ * handled.
+ *
+ * a handler consists of three values:
+ *   0: action1
+ *   1: action2
+ *   2: new emulation state
+ *
+ * action > 0: ButtonPress
+ * action = 0: nothing
+ * action < 0: ButtonRelease
+ *
+ * The comment preceeding each section is the current emulation state.
+ * The comments to the right are of the form
+ *      <button state> (<events>) -> <new emulation state>
+ * which should be read as
+ *      If the buttons are in <button state>, generate <events> then go to
+ *      <new emulation state>.
+ */
+static signed char stateTab[11][5][3] = {
+/* 0 ground */
+  {
+    {  0,  0,  0 },   /* nothing -> ground (no change) */
+    {  0,  0,  1 },   /* left -> delayed left */
+    {  0,  0,  2 },   /* right -> delayed right */
+    {  2,  0,  3 },   /* left & right (middle press) -> pressed middle */
+    {  0,  0, -1 }    /* timeout N/A */
+  },
+/* 1 delayed left */
+  {
+    {  1, -1,  0 },   /* nothing (left event) -> ground */
+    {  0,  0,  1 },   /* left -> delayed left (no change) */
+    {  1, -1,  2 },   /* right (left event) -> delayed right */
+    {  2,  0,  3 },   /* left & right (middle press) -> pressed middle */
+    {  1,  0,  4 },   /* timeout (left press) -> pressed left */
+  },
+/* 2 delayed right */
+  {
+    {  3, -3,  0 },   /* nothing (right event) -> ground */
+    {  3, -3,  1 },   /* left (right event) -> delayed left (no change) */
+    {  0,  0,  2 },   /* right -> delayed right (no change) */
+    {  2,  0,  3 },   /* left & right (middle press) -> pressed middle */
+    {  3,  0,  5 },   /* timeout (right press) -> pressed right */
+  },
+/* 3 pressed middle */
+  {
+    { -2,  0,  0 },   /* nothing (middle release) -> ground */
+    {  0,  0,  7 },   /* left -> released right */
+    {  0,  0,  6 },   /* right -> released left */
+    {  0,  0,  3 },   /* left & right -> pressed middle (no change) */
+    {  0,  0, -1 },   /* timeout N/A */
+  },
+/* 4 pressed left */
+  {
+    { -1,  0,  0 },   /* nothing (left release) -> ground */
+    {  0,  0,  4 },   /* left -> pressed left (no change) */
+    { -1,  0,  2 },   /* right (left release) -> delayed right */
+    {  3,  0, 10 },   /* left & right (right press) -> pressed both */
+    {  0,  0, -1 },   /* timeout N/A */
+  },
+/* 5 pressed right */
+  {
+    { -3,  0,  0 },   /* nothing (right release) -> ground */
+    { -3,  0,  1 },   /* left (right release) -> delayed left */
+    {  0,  0,  5 },   /* right -> pressed right (no change) */
+    {  1,  0, 10 },   /* left & right (left press) -> pressed both */
+    {  0,  0, -1 },   /* timeout N/A */
+  },
+/* 6 released left */
+  {
+    { -2,  0,  0 },   /* nothing (middle release) -> ground */
+    { -2,  0,  1 },   /* left (middle release) -> delayed left */
+    {  0,  0,  6 },   /* right -> released left (no change) */
+    {  1,  0,  8 },   /* left & right (left press) -> repressed left */
+    {  0,  0, -1 },   /* timeout N/A */
+  },
+/* 7 released right */
+  {
+    { -2,  0,  0 },   /* nothing (middle release) -> ground */
+    {  0,  0,  7 },   /* left -> released right (no change) */
+    { -2,  0,  2 },   /* right (middle release) -> delayed right */
+    {  3,  0,  9 },   /* left & right (right press) -> repressed right */
+    {  0,  0, -1 },   /* timeout N/A */
+  },
+/* 8 repressed left */
+  {
+    { -2, -1,  0 },   /* nothing (middle release, left release) -> ground */
+    { -2,  0,  4 },   /* left (middle release) -> pressed left */
+    { -1,  0,  6 },   /* right (left release) -> released left */
+    {  0,  0,  8 },   /* left & right -> repressed left (no change) */
+    {  0,  0, -1 },   /* timeout N/A */
+  },
+/* 9 repressed right */
+  {
+    { -2, -3,  0 },   /* nothing (middle release, right release) -> ground */
+    { -3,  0,  7 },   /* left (right release) -> released right */
+    { -2,  0,  5 },   /* right (middle release) -> pressed right */
+    {  0,  0,  9 },   /* left & right -> repressed right (no change) */
+    {  0,  0, -1 },   /* timeout N/A */
+  },
+/* 10 pressed both */
+  {
+    { -1, -3,  0 },   /* nothing (left release, right release) -> ground */
+    { -3,  0,  4 },   /* left (right release) -> pressed left */
+    { -1,  0,  5 },   /* right (left release) -> pressed right */
+    {  0,  0, 10 },   /* left & right -> pressed both (no change) */
+    {  0,  0, -1 },   /* timeout N/A */
+  },
+};
+
+
+int
+EvdevMBEmuTimer(InputInfoPtr pInfo)
+{
+    EvdevPtr pEvdev = pInfo->private;
+    int        sigstate;
+    int id;
+
+    sigstate = xf86BlockSIGIO ();
+
+    pEvdev->emulateMB.pending = FALSE;
+    if ((id = stateTab[pEvdev->emulateMB.state][4][0]) != 0) {
+        EvdevPostButtonEvent(pInfo, abs(id),
+                             (id >= 0) ? BUTTON_PRESS : BUTTON_RELEASE);
+        pEvdev->emulateMB.state =
+            stateTab[pEvdev->emulateMB.state][4][2];
+    } else {
+        ErrorF("Got unexpected buttonTimer in state %d\n",
+                pEvdev->emulateMB.state);
+    }
+
+    xf86UnblockSIGIO (sigstate);
+    return 0;
+}
+
+
+/**
+ * Emulate a middle button on button press.
+ *
+ * @param code button number (1 for left, 3 for right)
+ * @param press TRUE if press, FALSE if release.
+ *
+ * @return TRUE if event was swallowed by middle mouse button emulation, FALSE
+ * otherwise.
+ */
+BOOL
+EvdevMBEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL press)
+{
+    EvdevPtr pEvdev = pInfo->private;
+    int id;
+    int *btstate;
+    int ret = FALSE;
+
+    if (!pEvdev->emulateMB.enabled)
+        return ret;
+
+    /* don't care about other buttons */
+    if (button != 1 && button != 3)
+        return ret;
+
+    btstate = &pEvdev->emulateMB.buttonstate;
+    if (press)
+        *btstate |= (button == 1) ? 0x1 : 0x2;
+    else
+        *btstate &= (button == 1) ? ~0x1 : ~0x2;
+
+    if ((id = stateTab[pEvdev->emulateMB.state][*btstate][0]) != 0)
+    {
+        EvdevQueueButtonEvent(pInfo, abs(id), (id >= 0));
+        ret = TRUE;
+    }
+    if ((id = stateTab[pEvdev->emulateMB.state][*btstate][1]) != 0)
+    {
+        EvdevQueueButtonEvent(pInfo, abs(id), (id >= 0));
+        ret = TRUE;
+    }
+
+    pEvdev->emulateMB.state =
+        stateTab[pEvdev->emulateMB.state][*btstate][2];
+
+    if (stateTab[pEvdev->emulateMB.state][4][0] != 0) {
+        pEvdev->emulateMB.expires = GetTimeInMillis () + pEvdev->emulateMB.timeout;
+        pEvdev->emulateMB.pending = TRUE;
+        ret = TRUE;
+    } else {
+        pEvdev->emulateMB.pending = FALSE;
+    }
+
+    return ret;
+}
+
+
+void EvdevMBEmuWakeupHandler(pointer data,
+                             int i,
+                             pointer LastSelectMask)
+{
+    InputInfoPtr pInfo = (InputInfoPtr)data;
+    EvdevPtr     pEvdev = (EvdevPtr)pInfo->private;
+    int ms;
+
+    if (pEvdev->emulateMB.pending)
+    {
+        ms = pEvdev->emulateMB.expires - GetTimeInMillis();
+        if (ms <= 0)
+            EvdevMBEmuTimer(pInfo);
+    }
+}
+
+void EvdevMBEmuBlockHandler(pointer data,
+                            struct timeval **waitTime,
+                            pointer LastSelectMask)
+{
+    InputInfoPtr    pInfo = (InputInfoPtr) data;
+    EvdevPtr        pEvdev= (EvdevPtr) pInfo->private;
+    int             ms;
+
+    if (pEvdev->emulateMB.pending)
+    {
+        ms = pEvdev->emulateMB.expires - GetTimeInMillis ();
+        if (ms <= 0)
+            ms = 0;
+        AdjustWaitForDelay (waitTime, ms);
+    }
+}
+
+void
+EvdevMBEmuPreInit(InputInfoPtr pInfo)
+{
+    EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+
+    pEvdev->emulateMB.enabled = xf86SetBoolOption(pInfo->options,
+                                                  "Emulate3Buttons",
+                                                  FALSE);
+    pEvdev->emulateMB.timeout = xf86SetIntOption(pInfo->options,
+                                                 "Emulate3Timeout", 50);
+}
+
+void
+EvdevMBEmuOn(InputInfoPtr pInfo)
+{
+    if (!pInfo->dev->button) /* don't init for keyboards */
+        return;
+
+    RegisterBlockAndWakeupHandlers (EvdevMBEmuBlockHandler,
+                                    EvdevMBEmuWakeupHandler,
+                                    (pointer)pInfo);
+}
+
+void
+EvdevMBEmuFinalize(InputInfoPtr pInfo)
+{
+    if (!pInfo->dev->button) /* don't cleanup for keyboards */
+        return;
+
+    RemoveBlockAndWakeupHandlers (EvdevMBEmuBlockHandler,
+                                  EvdevMBEmuWakeupHandler,
+                                  (pointer)pInfo);
+
+}
+
+static int
+EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
+                      BOOL checkonly)
+{
+    InputInfoPtr pInfo  = dev->public.devicePrivate;
+    EvdevPtr     pEvdev = pInfo->private;
+
+    if (atom == prop_mbemu)
+    {
+        if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        if (!checkonly)
+            pEvdev->emulateMB.enabled = *((BOOL*)val->data);
+    } else if (atom == prop_mbtimeout)
+    {
+        if (val->format != 32 || val->size != 1 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        if (!checkonly)
+            pEvdev->emulateMB.timeout = *((CARD32*)val->data);
+    }
+
+    return Success;
+}
+
+/**
+ * Initialise property for MB emulation on/off.
+ */
+void
+EvdevMBEmuInitProperty(DeviceIntPtr dev)
+{
+    InputInfoPtr pInfo  = dev->public.devicePrivate;
+    EvdevPtr     pEvdev = pInfo->private;
+    int          rc;
+
+    if (!dev->button) /* don't init prop for keyboards */
+        return;
+
+    prop_mbemu = MakeAtom(EVDEV_PROP_MIDBUTTON, strlen(EVDEV_PROP_MIDBUTTON), TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_mbemu, XA_INTEGER, 8,
+                                PropModeReplace, 1,
+                                &pEvdev->emulateMB.enabled,
+                                FALSE);
+    if (rc != Success)
+        return;
+    XISetDevicePropertyDeletable(dev, prop_mbemu, FALSE);
+
+    prop_mbtimeout = MakeAtom(EVDEV_PROP_MIDBUTTON_TIMEOUT,
+                              strlen(EVDEV_PROP_MIDBUTTON_TIMEOUT),
+                              TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_mbtimeout, XA_INTEGER, 32, PropModeReplace, 1,
+                                &pEvdev->emulateMB.timeout, FALSE);
+
+    if (rc != Success)
+        return;
+    XISetDevicePropertyDeletable(dev, prop_mbtimeout, FALSE);
+
+    XIRegisterPropertyHandler(dev, EvdevMBEmuSetProperty, NULL, NULL);
+}
diff --git a/src/emuThird.c b/src/emuThird.c
new file mode 100644 (file)
index 0000000..7461767
--- /dev/null
@@ -0,0 +1,416 @@
+/*
+ * Copyright © 2011 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of the authors
+ * not be used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.  The authors make no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+/* Right mouse button emulation code.
+ * Emulates a right button event if the first button is held down for a
+ * timeout. If the device moves more than a certain amount before the
+ * timeout is over, the emulation is cancelled and a normal button event is
+ * generated.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "evdev.h"
+
+#include <X11/Xatom.h>
+#include <xf86.h>
+#include <xf86Xinput.h>
+#include <exevents.h>
+
+#include <evdev-properties.h>
+
+/* Threshold (in device coordinates) for devices to cancel emulation */
+#define DEFAULT_MOVE_THRESHOLD 20
+
+static Atom prop_3bemu;         /* Right button emulation on/off property   */
+static Atom prop_3btimeout;     /* Right button timeout property            */
+static Atom prop_3bbutton;      /* Right button target physical button      */
+static Atom prop_3bthreshold;   /* Right button move cancellation threshold */
+
+/* State machine for 3rd button emulation */
+enum EmulationState {
+    EM3B_OFF,             /* no event      */
+    EM3B_PENDING,         /* timer pending */
+    EM3B_EMULATING        /* in emulation  */
+};
+
+static void
+Evdev3BEmuPostButtonEvent(InputInfoPtr pInfo, int button, enum ButtonAction act)
+{
+    EvdevPtr          pEvdev   = pInfo->private;
+    struct emulate3B *emu3B    = &pEvdev->emulate3B;
+    int               absolute = Relative;
+
+    /* if we cancel, emit the button down event at our start position,
+     * not at the current position. Only for absolute devices though. For
+     * relative events, this may be a bit iffy since pointer accel may shoot
+     * us back more than we moved and confuse the user.
+     */
+    if (emu3B->flags & EVDEV_ABSOLUTE_EVENTS)
+        absolute = Absolute;
+
+    xf86PostButtonEventP(pInfo->dev, absolute, button,
+                         (act == BUTTON_PRESS) ? 1 : 0, 0,
+                         (absolute ? 2 : 0), emu3B->startpos);
+}
+
+
+/**
+ * Timer function. Post a button down event to the server.
+ *
+ * @param arg The InputInfoPtr for this device.
+ */
+CARD32
+Evdev3BEmuTimer(OsTimerPtr timer, CARD32 time, pointer arg)
+{
+    InputInfoPtr      pInfo    = (InputInfoPtr)arg;
+    EvdevPtr          pEvdev   = pInfo->private;
+    struct emulate3B *emu3B    = &pEvdev->emulate3B;
+    int               sigstate = 0;
+
+    sigstate = xf86BlockSIGIO ();
+    emu3B->state = EM3B_EMULATING;
+    Evdev3BEmuPostButtonEvent(pInfo, emu3B->button, BUTTON_PRESS);
+    xf86UnblockSIGIO (sigstate);
+    return 0;
+}
+
+
+/**
+ * Cancel all emulation, reset the timer and reset deltas.
+ */
+static void
+Evdev3BCancel(InputInfoPtr pInfo)
+{
+    EvdevPtr          pEvdev = pInfo->private;
+    struct emulate3B *emu3B  = &pEvdev->emulate3B;
+
+    if (emu3B->state != EM3B_OFF)
+    {
+        TimerCancel(emu3B->timer);
+        emu3B->state = EM3B_OFF;
+        memset(emu3B->delta, 0, sizeof(emu3B->delta));
+    }
+
+    emu3B->flags = 0;
+}
+
+/**
+ * Emulate a third button on button press. Note that emulation only triggers
+ * on button 1.
+ *
+ * Return TRUE if event was swallowed by middle mouse button emulation,
+ * FALSE otherwise.
+ */
+BOOL
+Evdev3BEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL press)
+{
+    EvdevPtr          pEvdev = pInfo->private;
+    struct emulate3B *emu3B  = &pEvdev->emulate3B;
+    int               ret    = FALSE;
+
+    if (!emu3B->enabled)
+        goto out;
+
+    if (press)
+        emu3B->buttonstate |= button;
+    else
+        emu3B->buttonstate &= ~button;
+
+    /* Any other button pressed? Cancel timer */
+    if (button != 1)
+    {
+        switch (emu3B->state)
+        {
+            case EM3B_PENDING:
+                Evdev3BEmuPostButtonEvent(pInfo, 1, BUTTON_PRESS);
+                Evdev3BCancel(pInfo);
+                break;
+            case EM3B_EMULATING:
+                /* We're emulating and now the user pressed a different
+                 * button. Just release the emulating one, tell the user to
+                 * not do that and get on with life */
+                Evdev3BEmuPostButtonEvent(pInfo, emu3B->button, BUTTON_RELEASE);
+                Evdev3BCancel(pInfo);
+                break;
+            default:
+                break;
+        }
+        goto out;
+    }
+
+    /* Don't emulate if any other button is down */
+    if ((emu3B->buttonstate & ~0x1) != 0)
+        goto out;
+
+    /* Release event → cancel, send press and release now. */
+    if (!press)
+    {
+        switch(emu3B->state)
+        {
+            case EM3B_PENDING:
+                Evdev3BEmuPostButtonEvent(pInfo, 1, BUTTON_PRESS);
+                Evdev3BCancel(pInfo);
+                break;
+            case EM3B_EMULATING:
+                Evdev3BEmuPostButtonEvent(pInfo, emu3B->button, BUTTON_RELEASE);
+                Evdev3BCancel(pInfo);
+                ret = TRUE;
+                break;
+            default:
+                break;
+        }
+
+        goto out;
+    }
+
+    if (press && emu3B->state == EM3B_OFF)
+    {
+        emu3B->state = EM3B_PENDING;
+        emu3B->timer = TimerSet(emu3B->timer, 0, emu3B->timeout,
+                                Evdev3BEmuTimer, pInfo);
+        ret = TRUE;
+        goto out;
+    }
+
+out:
+    return ret;
+}
+
+/**
+ * Handle absolute x/y motion. If the motion is above the threshold, cancel
+ * emulation.
+ */
+void
+Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals)
+{
+    EvdevPtr          pEvdev = pInfo->private;
+    struct emulate3B *emu3B  = &pEvdev->emulate3B;
+    int               cancel = FALSE;
+    int               axis   = 0;
+
+    if (emu3B->state != EM3B_PENDING)
+    {
+        if (valuator_mask_isset(vals, 0))
+            emu3B->startpos[0] = valuator_mask_get(vals, 0);
+        if (valuator_mask_isset(vals, 1))
+            emu3B->startpos[1] = valuator_mask_get(vals, 1);
+
+        return;
+    }
+
+    if ((emu3B->flags & EVDEV_ABSOLUTE_EVENTS) == 0)
+        emu3B->flags |= EVDEV_ABSOLUTE_EVENTS;
+
+    while (axis <= 1 && !cancel)
+    {
+        if (valuator_mask_isset(vals, axis))
+        {
+            int delta = valuator_mask_get(vals, axis) - emu3B->startpos[axis];
+            if (abs(delta) > emu3B->threshold)
+                cancel = TRUE;
+        }
+        axis++;
+    }
+
+    if (cancel)
+    {
+        Evdev3BEmuPostButtonEvent(pInfo, 1, BUTTON_PRESS);
+        Evdev3BCancel(pInfo);
+    }
+}
+
+/**
+ * Handle relative x/y motion. If the motion is above the threshold, cancel
+ * emulation.
+ */
+void
+Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, int dx, int dy)
+{
+    EvdevPtr          pEvdev = pInfo->private;
+    struct emulate3B *emu3B  = &pEvdev->emulate3B;
+
+    if (emu3B->state != EM3B_PENDING)
+        return;
+
+    emu3B->delta[0] += dx;
+    emu3B->delta[1] += dy;
+    emu3B->flags |= EVDEV_RELATIVE_EVENTS;
+
+    if (abs(emu3B->delta[0]) > emu3B->threshold ||
+        abs(emu3B->delta[1]) > emu3B->threshold)
+    {
+        Evdev3BEmuPostButtonEvent(pInfo, 1, BUTTON_PRESS);
+        Evdev3BCancel(pInfo);
+    }
+}
+
+void
+Evdev3BEmuPreInit(InputInfoPtr pInfo)
+{
+    EvdevPtr          pEvdev = pInfo->private;
+    struct emulate3B *emu3B  = &pEvdev->emulate3B;
+
+    emu3B->enabled = xf86SetBoolOption(pInfo->options,
+                                       "EmulateThirdButton",
+                                       FALSE);
+    emu3B->timeout = xf86SetIntOption(pInfo->options,
+                                      "EmulateThirdButtonTimeout",
+                                      1000);
+    emu3B->button = xf86SetIntOption(pInfo->options,
+                                      "EmulateThirdButtonButton",
+                                      3);
+    /* FIXME: this should be auto-configured based on axis ranges */
+    emu3B->threshold = xf86SetIntOption(pInfo->options,
+                                         "EmulateThirdButtonMoveThreshold",
+                                         DEFAULT_MOVE_THRESHOLD);
+    /* allocate now so we don't allocate in the signal handler */
+    emu3B->timer = TimerSet(NULL, 0, 0, NULL, NULL);
+}
+
+void
+Evdev3BEmuOn(InputInfoPtr pInfo)
+{
+    /* This function just exists for symmetry in evdev.c */
+}
+
+void
+Evdev3BEmuFinalize(InputInfoPtr pInfo)
+{
+    EvdevPtr          pEvdev = pInfo->private;
+    struct emulate3B *emu3B  = &pEvdev->emulate3B;
+
+    TimerFree(emu3B->timer);
+    emu3B->timer = NULL;
+}
+
+static int
+Evdev3BEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
+                      BOOL checkonly)
+{
+    InputInfoPtr      pInfo  = dev->public.devicePrivate;
+    EvdevPtr          pEvdev = pInfo->private;
+    struct emulate3B *emu3B  = &pEvdev->emulate3B;
+
+    if (atom == prop_3bemu)
+    {
+        if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        if (!checkonly)
+            emu3B->enabled = *((BOOL*)val->data);
+
+    } else if (atom == prop_3btimeout)
+    {
+        if (val->format != 32 || val->size != 1 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        if (!checkonly)
+            emu3B->timeout = *((CARD32*)val->data);
+
+    } else if (atom == prop_3bbutton)
+    {
+        if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        if (!checkonly)
+            emu3B->button = *((CARD8*)val->data);
+    } else if (atom == prop_3bthreshold)
+    {
+        if (val->format != 32 || val->size != 1 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        if (!checkonly)
+            emu3B->threshold = *((CARD32*)val->data);
+    }
+
+
+    return Success;
+}
+
+/**
+ * Initialise properties for third button emulation
+ */
+void
+Evdev3BEmuInitProperty(DeviceIntPtr dev)
+{
+    InputInfoPtr      pInfo  = dev->public.devicePrivate;
+    EvdevPtr          pEvdev = pInfo->private;
+    struct emulate3B *emu3B  = &pEvdev->emulate3B;
+    int               rc;
+
+    if (!dev->button) /* don't init prop for keyboards */
+        return;
+
+    /* third button emulation on/off */
+    prop_3bemu = MakeAtom(EVDEV_PROP_THIRDBUTTON, strlen(EVDEV_PROP_THIRDBUTTON), TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_3bemu, XA_INTEGER, 8,
+                                PropModeReplace, 1,
+                                &emu3B->enabled,
+                                FALSE);
+    if (rc != Success)
+        return;
+
+    XISetDevicePropertyDeletable(dev, prop_3bemu, FALSE);
+
+    /* third button emulation timeout */
+    prop_3btimeout = MakeAtom(EVDEV_PROP_THIRDBUTTON_TIMEOUT,
+                              strlen(EVDEV_PROP_THIRDBUTTON_TIMEOUT),
+                              TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_3btimeout, XA_INTEGER, 32, PropModeReplace, 1,
+                                &emu3B->timeout, FALSE);
+
+    if (rc != Success)
+        return;
+
+    XISetDevicePropertyDeletable(dev, prop_3btimeout, FALSE);
+
+    /* third button emulation button to be triggered  */
+    prop_3bbutton = MakeAtom(EVDEV_PROP_THIRDBUTTON_BUTTON,
+                             strlen(EVDEV_PROP_THIRDBUTTON_BUTTON),
+                             TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_3bbutton, XA_INTEGER, 8, PropModeReplace, 1,
+                                &emu3B->button, FALSE);
+
+    if (rc != Success)
+        return;
+
+    XISetDevicePropertyDeletable(dev, prop_3bbutton, FALSE);
+
+    /* third button emulation movement threshold */
+    prop_3bthreshold = MakeAtom(EVDEV_PROP_THIRDBUTTON_THRESHOLD,
+                                strlen(EVDEV_PROP_THIRDBUTTON_THRESHOLD),
+                                TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_3bthreshold, XA_INTEGER, 32, PropModeReplace, 1,
+                                &emu3B->threshold, FALSE);
+
+    if (rc != Success)
+        return;
+
+    XISetDevicePropertyDeletable(dev, prop_3bthreshold, FALSE);
+
+    XIRegisterPropertyHandler(dev, Evdev3BEmuSetProperty, NULL, NULL);
+}
diff --git a/src/emuWheel.c b/src/emuWheel.c
new file mode 100644 (file)
index 0000000..ae894fa
--- /dev/null
@@ -0,0 +1,480 @@
+/*
+* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+* Copyright 1993 by David Dawes <dawes@xfree86.org>
+* Copyright 2002 by SuSE Linux AG, Author: Egbert Eich
+* Copyright 1994-2002 by The XFree86 Project, Inc.
+* Copyright 2002 by Paul Elliott
+* (Ported from xf86-input-mouse, above copyrights taken from there)
+* Copyright 2008 by Chris Salch
+* Copyright © 2008 Red Hat, Inc.
+*
+* Permission to use, copy, modify, distribute, and sell this software
+* and its documentation for any purpose is hereby granted without
+* fee, provided that the above copyright notice appear in all copies
+* and that both that copyright notice and this permission notice
+* appear in supporting documentation, and that the name of the authors
+* not be used in advertising or publicity pertaining to distribution of the
+* software without specific, written prior permission.  The authors make no
+* representations about the suitability of this software for any
+* purpose.  It is provided "as is" without express or implied
+* warranty.
+*
+* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*
+*/
+
+/* Mouse wheel emulation code. */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "evdev.h"
+
+#include <X11/Xatom.h>
+#include <xf86.h>
+#include <xf86Xinput.h>
+#include <exevents.h>
+
+#include <evdev-properties.h>
+
+#define WHEEL_NOT_CONFIGURED 0
+
+static Atom prop_wheel_emu      = 0;
+static Atom prop_wheel_axismap  = 0;
+static Atom prop_wheel_inertia  = 0;
+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 */
+BOOL
+EvdevWheelEmuFilterButton(InputInfoPtr pInfo, unsigned int button, int value)
+{
+    EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+    int ms;
+
+    /* Has wheel emulation been configured to be enabled? */
+    if (!pEvdev->emulateWheel.enabled)
+       return FALSE;
+
+    /* Check for EmulateWheelButton */
+    if (pEvdev->emulateWheel.button == button) {
+       pEvdev->emulateWheel.button_state = value;
+
+        if (value)
+            /* Start the timer when the button is pressed */
+            pEvdev->emulateWheel.expires = pEvdev->emulateWheel.timeout +
+                                           GetTimeInMillis();
+        else {
+            ms = pEvdev->emulateWheel.expires - GetTimeInMillis();
+            if (ms > 0) {
+                /*
+                 * If the button is released early enough emit the button
+                 * press/release events
+                 */
+                EvdevQueueButtonClicks(pInfo, button, 1);
+            }
+        }
+
+       return TRUE;
+    }
+
+    /* Don't care about this event */
+    return FALSE;
+}
+
+/* Filter mouse wheel events */
+BOOL
+EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
+{
+    EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+    WheelAxisPtr pAxis = NULL, pOtherAxis = NULL;
+    int value = pEv->value;
+    int oldValue;
+
+    /* Has wheel emulation been configured to be enabled? */
+    if (!pEvdev->emulateWheel.enabled)
+       return FALSE;
+
+    /* Handle our motion events if the emuWheel button is pressed
+     * wheel button of 0 means always emulate wheel.
+     */
+    if (pEvdev->emulateWheel.button_state || !pEvdev->emulateWheel.button) {
+        /* Just return if the timeout hasn't expired yet */
+        if (pEvdev->emulateWheel.button)
+        {
+            int ms = pEvdev->emulateWheel.expires - GetTimeInMillis();
+            if (ms > 0)
+                return TRUE;
+        }
+
+       /* We don't want to intercept real mouse wheel events */
+       if(pEv->type == EV_ABS) {
+           int axis = pEvdev->axis_map[pEv->code];
+           oldValue = valuator_mask_get(pEvdev->vals, axis);
+           valuator_mask_set(pEvdev->vals, axis, value);
+           value -= oldValue; /* make value into a differential measurement */
+       }
+
+       switch(pEv->code) {
+
+       /* ABS_X has the same value as REL_X, so this case catches both */
+       case REL_X:
+           pAxis = &(pEvdev->emulateWheel.X);
+           pOtherAxis = &(pEvdev->emulateWheel.Y);
+           break;
+
+       /* ABS_Y has the same value as REL_Y, so this case catches both */
+       case REL_Y:
+           pAxis = &(pEvdev->emulateWheel.Y);
+           pOtherAxis = &(pEvdev->emulateWheel.X);
+           break;
+
+       default:
+           break;
+       }
+
+       /* If we found REL_X, REL_Y, ABS_X or ABS_Y then emulate a mouse
+          wheel.  Reset the inertia of the other axis when a scroll event
+          was sent to avoid the buildup of erroneous scroll events if the
+          user doesn't move in a perfectly straight line.
+        */
+       if (pAxis)
+       {
+           if (EvdevWheelEmuInertia(pInfo, pAxis, value))
+               pOtherAxis->traveled_distance = 0;
+       }
+
+       /* Eat motion events while emulateWheel button pressed. */
+       return TRUE;
+    }
+
+    return FALSE;
+}
+
+/* Simulate inertia for our emulated mouse wheel.
+   Returns the number of wheel events generated.
+ */
+static int
+EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value)
+{
+    EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+    int button;
+    int inertia;
+    int rc = 0;
+
+    /* if this axis has not been configured, just eat the motion */
+    if (!axis->up_button)
+       return rc;
+
+    axis->traveled_distance += value;
+
+    if (axis->traveled_distance < 0) {
+       button = axis->up_button;
+       inertia = -pEvdev->emulateWheel.inertia;
+    } else {
+       button = axis->down_button;
+       inertia = pEvdev->emulateWheel.inertia;
+    }
+
+    /* Produce button press events for wheel motion */
+    while(abs(axis->traveled_distance) > pEvdev->emulateWheel.inertia) {
+       axis->traveled_distance -= inertia;
+       EvdevQueueButtonClicks(pInfo, button, 1);
+       rc++;
+    }
+    return rc;
+}
+
+/* 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)
+{
+    EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+    char *option_string;
+
+    pAxis->up_button = WHEEL_NOT_CONFIGURED;
+
+    /* Check to see if there is configuration for this axis */
+    option_string = xf86SetStrOption(pInfo->options, axis_name, NULL);
+    if (option_string) {
+       int up_button = 0;
+       int down_button = 0;
+       char *msg = NULL;
+
+       if ((sscanf(option_string, "%d %d", &up_button, &down_button) == 2) &&
+           ((up_button > 0) && (up_button <= EVDEV_MAXBUTTONS)) &&
+           ((down_button > 0) && (down_button <= EVDEV_MAXBUTTONS))) {
+
+           /* Use xstrdup to allocate a string for us */
+           msg = xstrdup("buttons XX and YY");
+
+           if (msg)
+               sprintf(msg, "buttons %d and %d", up_button, down_button);
+
+           pAxis->up_button = up_button;
+           pAxis->down_button = down_button;
+
+           /* Update the number of buttons if needed */
+           if (up_button > pEvdev->num_buttons) pEvdev->num_buttons = up_button;
+           if (down_button > pEvdev->num_buttons) pEvdev->num_buttons = down_button;
+
+       } else {
+           xf86IDrvMsg(pInfo, X_WARNING, "Invalid %s value:\"%s\"\n",
+                       axis_name, option_string);
+       }
+       free(option_string);
+
+       /* Clean up and log what happened */
+       if (msg) {
+           xf86IDrvMsg(pInfo, X_CONFIG, "%s: %s\n", axis_name, msg);
+           free(msg);
+           return TRUE;
+       }
+    }
+    return FALSE;
+}
+
+/* Setup the basic configuration options used by mouse wheel emulation */
+void
+EvdevWheelEmuPreInit(InputInfoPtr pInfo)
+{
+    EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+    int wheelButton;
+    int inertia;
+    int timeout;
+
+    if (xf86SetBoolOption(pInfo->options, "EmulateWheel", FALSE)) {
+       pEvdev->emulateWheel.enabled = TRUE;
+    } else
+        pEvdev->emulateWheel.enabled = FALSE;
+
+    wheelButton = xf86SetIntOption(pInfo->options, "EmulateWheelButton", 4);
+
+    if ((wheelButton < 0) || (wheelButton > EVDEV_MAXBUTTONS)) {
+        xf86IDrvMsg(pInfo, X_WARNING, "Invalid EmulateWheelButton value: %d\n",
+                    wheelButton);
+        xf86IDrvMsg(pInfo, X_WARNING, "Wheel emulation disabled.\n");
+
+        pEvdev->emulateWheel.enabled = FALSE;
+    }
+
+    pEvdev->emulateWheel.button = wheelButton;
+
+    inertia = xf86SetIntOption(pInfo->options, "EmulateWheelInertia", 10);
+
+    if (inertia <= 0) {
+        xf86IDrvMsg(pInfo, X_WARNING, "Invalid EmulateWheelInertia value: %d\n",
+                    inertia);
+        xf86IDrvMsg(pInfo, X_WARNING, "Using built-in inertia value.\n");
+
+        inertia = 10;
+    }
+
+    pEvdev->emulateWheel.inertia = inertia;
+
+    timeout = xf86SetIntOption(pInfo->options, "EmulateWheelTimeout", 200);
+
+    if (timeout < 0) {
+        xf86IDrvMsg(pInfo, X_WARNING, "Invalid EmulateWheelTimeout value: %d\n",
+                    timeout);
+        xf86IDrvMsg(pInfo, X_WARNING, "Using built-in timeout value.\n");
+
+        timeout = 200;
+    }
+
+    pEvdev->emulateWheel.timeout = timeout;
+
+    /* Configure the Y axis or default it */
+    if (!EvdevWheelEmuHandleButtonMap(pInfo, &(pEvdev->emulateWheel.Y),
+                "YAxisMapping")) {
+        /* Default the Y axis to sane values */
+        pEvdev->emulateWheel.Y.up_button = 4;
+        pEvdev->emulateWheel.Y.down_button = 5;
+
+        /* Simpler to check just the largest value in this case */
+        /* XXX: we should post this to the server */
+        if (5 > pEvdev->num_buttons)
+            pEvdev->num_buttons = 5;
+
+        /* Display default Configuration */
+        xf86IDrvMsg(pInfo, X_CONFIG, "YAxisMapping: buttons %d and %d\n",
+                    pEvdev->emulateWheel.Y.up_button,
+                    pEvdev->emulateWheel.Y.down_button);
+    }
+
+
+    /* This axis should default to an unconfigured state as most people
+       are not going to expect a Horizontal wheel. */
+    EvdevWheelEmuHandleButtonMap(pInfo, &(pEvdev->emulateWheel.X),
+            "XAxisMapping");
+
+    /* Used by the inertia code */
+    pEvdev->emulateWheel.X.traveled_distance = 0;
+    pEvdev->emulateWheel.Y.traveled_distance = 0;
+
+    xf86IDrvMsg(pInfo, X_CONFIG,
+                "EmulateWheelButton: %d, "
+                "EmulateWheelInertia: %d, "
+                "EmulateWheelTimeout: %d\n",
+                pEvdev->emulateWheel.button, inertia, timeout);
+}
+
+static int
+EvdevWheelEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
+                         BOOL checkonly)
+{
+    InputInfoPtr pInfo  = dev->public.devicePrivate;
+    EvdevPtr     pEvdev = pInfo->private;
+
+    if (atom == prop_wheel_emu)
+    {
+        if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        if (!checkonly)
+        {
+            pEvdev->emulateWheel.enabled = *((BOOL*)val->data);
+            /* Don't enable with zero inertia, otherwise we may get stuck in an
+             * infinite loop */
+            if (pEvdev->emulateWheel.inertia <= 0)
+            {
+                pEvdev->emulateWheel.inertia = 10;
+                /* We may get here before the property is actually enabled */
+                if (prop_wheel_inertia)
+                    XIChangeDeviceProperty(dev, prop_wheel_inertia, XA_INTEGER,
+                            16, PropModeReplace, 1,
+                            &pEvdev->emulateWheel.inertia, TRUE);
+            }
+        }
+    }
+    else if (atom == prop_wheel_button)
+    {
+        int bt;
+
+        if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        bt = *((CARD8*)val->data);
+
+        if (bt < 0 || bt >= EVDEV_MAXBUTTONS)
+            return BadValue;
+
+        if (!checkonly)
+            pEvdev->emulateWheel.button = bt;
+    } else if (atom == prop_wheel_axismap)
+    {
+        if (val->format != 8 || val->size != 4 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        if (!checkonly)
+        {
+            pEvdev->emulateWheel.X.up_button = *((CARD8*)val->data);
+            pEvdev->emulateWheel.X.down_button = *(((CARD8*)val->data) + 1);
+            pEvdev->emulateWheel.Y.up_button = *(((CARD8*)val->data) + 2);
+            pEvdev->emulateWheel.Y.down_button = *(((CARD8*)val->data) + 3);
+        }
+    } else if (atom == prop_wheel_inertia)
+    {
+        int inertia;
+
+        if (val->format != 16 || val->size != 1 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        inertia = *((CARD16*)val->data);
+
+        if (inertia < 0)
+            return BadValue;
+
+        if (!checkonly)
+            pEvdev->emulateWheel.inertia = inertia;
+    } else if (atom == prop_wheel_timeout)
+    {
+        int timeout;
+
+        if (val->format != 16 || val->size != 1 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        timeout = *((CARD16*)val->data);
+
+        if (timeout < 0)
+            return BadValue;
+
+        if (!checkonly)
+            pEvdev->emulateWheel.timeout = timeout;
+    }
+    return Success;
+}
+
+void
+EvdevWheelEmuInitProperty(DeviceIntPtr dev)
+{
+    InputInfoPtr pInfo  = dev->public.devicePrivate;
+    EvdevPtr     pEvdev = pInfo->private;
+    int          rc     = TRUE;
+    char         vals[4];
+
+    if (!dev->button) /* don't init prop for keyboards */
+        return;
+
+    prop_wheel_emu = MakeAtom(EVDEV_PROP_WHEEL, strlen(EVDEV_PROP_WHEEL), TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_wheel_emu, XA_INTEGER, 8,
+                                PropModeReplace, 1,
+                                &pEvdev->emulateWheel.enabled, FALSE);
+    if (rc != Success)
+        return;
+
+    XISetDevicePropertyDeletable(dev, prop_wheel_emu, FALSE);
+
+    vals[0] = pEvdev->emulateWheel.X.up_button;
+    vals[1] = pEvdev->emulateWheel.X.down_button;
+    vals[2] = pEvdev->emulateWheel.Y.up_button;
+    vals[3] = pEvdev->emulateWheel.Y.down_button;
+
+    prop_wheel_axismap = MakeAtom(EVDEV_PROP_WHEEL_AXES, strlen(EVDEV_PROP_WHEEL_AXES), TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_wheel_axismap, XA_INTEGER, 8,
+                                PropModeReplace, 4, vals, FALSE);
+
+    if (rc != Success)
+        return;
+
+    XISetDevicePropertyDeletable(dev, prop_wheel_axismap, FALSE);
+
+    prop_wheel_inertia = MakeAtom(EVDEV_PROP_WHEEL_INERTIA, strlen(EVDEV_PROP_WHEEL_INERTIA), TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_wheel_inertia, XA_INTEGER, 16,
+                                PropModeReplace, 1,
+                                &pEvdev->emulateWheel.inertia, FALSE);
+    if (rc != Success)
+        return;
+
+    XISetDevicePropertyDeletable(dev, prop_wheel_inertia, FALSE);
+
+    prop_wheel_timeout = MakeAtom(EVDEV_PROP_WHEEL_TIMEOUT, strlen(EVDEV_PROP_WHEEL_TIMEOUT), TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_wheel_timeout, XA_INTEGER, 16,
+                                PropModeReplace, 1,
+                                &pEvdev->emulateWheel.timeout, FALSE);
+    if (rc != Success)
+        return;
+
+    XISetDevicePropertyDeletable(dev, prop_wheel_timeout, FALSE);
+
+    prop_wheel_button = MakeAtom(EVDEV_PROP_WHEEL_BUTTON, strlen(EVDEV_PROP_WHEEL_BUTTON), TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_wheel_button, XA_INTEGER, 8,
+                                PropModeReplace, 1,
+                                &pEvdev->emulateWheel.button, FALSE);
+    if (rc != Success)
+        return;
+
+    XISetDevicePropertyDeletable(dev, prop_wheel_button, FALSE);
+
+    XIRegisterPropertyHandler(dev, EvdevWheelEmuSetProperty, NULL, NULL);
+}
diff --git a/src/evdev.c b/src/evdev.c
new file mode 100755 (executable)
index 0000000..27f3a6c
--- /dev/null
@@ -0,0 +1,3701 @@
+/*
+ *
+ * xserver-xorg-input-evdev
+ *
+ * Contact: Sung-Jin Park <sj76.park@samsung.com>
+ *          Sangjin LEE <lsj119@samsung.com>
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright © 2004-2008 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of Red Hat
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.  Red
+ * Hat makes no representations about the suitability of this software
+ * for any purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors:
+ *     Kristian Høgsberg (krh@redhat.com)
+ *     Adam Jackson (ajax@redhat.com)
+ *     Peter Hutterer (peter.hutterer@redhat.com)
+ *     Oliver McFadden (oliver.mcfadden@nokia.com)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "evdev.h"
+
+#include <X11/keysym.h>
+#include <X11/extensions/XI.h>
+
+#include <linux/version.h>
+#include <sys/stat.h>
+#include <libudev.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#include <xf86.h>
+#include <xf86Xinput.h>
+#include <exevents.h>
+#include <xorgVersion.h>
+#include <xkbsrv.h>
+
+#include <X11/Xatom.h>
+#include <evdev-properties.h>
+#include <xserver-properties.h>
+
+#ifdef _F_EVDEV_CONFINE_REGION_
+#include <xorg/mipointrst.h>
+
+#define MIPOINTER(dev) \
+    ((!IsMaster(dev) && !dev->master) ? \
+        (miPointerPtr)dixLookupPrivate(&(dev)->devPrivates, miPointerPrivKey): \
+        (miPointerPtr)dixLookupPrivate(&(GetMaster(dev, MASTER_POINTER))->devPrivates, miPointerPrivKey))
+
+#endif /* _F_EVDEV_CONFINE_REGION_ */
+
+#ifndef XI_PROP_PRODUCT_ID
+#define XI_PROP_PRODUCT_ID "Device Product ID"
+#endif
+
+#ifndef XI_PROP_VIRTUAL_DEVICE
+#define XI_PROP_VIRTUAL_DEVICE "Virtual Device"
+#endif
+
+#ifndef XI_PROP_DEVICE_TYPE
+#define XI_PROP_DEVICE_TYPE "Device Type"
+#endif
+
+/* removed from server, purge when dropping support for server 1.10 */
+#define XI86_SEND_DRAG_EVENTS   0x08
+
+#ifndef MAXDEVICES
+#include <inputstr.h> /* for MAX_DEVICES */
+#define MAXDEVICES MAX_DEVICES
+#endif
+
+#define ArrayLength(a) (sizeof(a) / (sizeof((a)[0])))
+
+#define MIN_KEYCODE 8
+#define GLYPHS_PER_KEY 2
+#define AltMask                Mod1Mask
+#define NumLockMask    Mod2Mask
+#define AltLangMask    Mod3Mask
+#define KanaMask       Mod4Mask
+#define ScrollLockMask Mod5Mask
+
+#define CAPSFLAG       1
+#define NUMFLAG                2
+#define SCROLLFLAG     4
+#define MODEFLAG       8
+#define COMPOSEFLAG    16
+
+#ifndef ABS_MT_SLOT
+#define ABS_MT_SLOT 0x2f
+#endif
+
+#ifndef ABS_MT_TRACKING_ID
+#define ABS_MT_TRACKING_ID 0x39
+#endif
+
+static char *evdevDefaults[] = {
+    "XkbRules",     "evdev",
+    "XkbModel",     "evdev",
+    "XkbLayout",    "us",
+    NULL
+};
+
+/* Any of those triggers a proximity event */
+static int proximity_bits[] = {
+        BTN_TOOL_PEN,
+        BTN_TOOL_RUBBER,
+        BTN_TOOL_BRUSH,
+        BTN_TOOL_PENCIL,
+        BTN_TOOL_AIRBRUSH,
+        BTN_TOOL_FINGER,
+        BTN_TOOL_MOUSE,
+        BTN_TOOL_LENS,
+};
+
+static int EvdevOn(DeviceIntPtr);
+static int EvdevCache(InputInfoPtr pInfo);
+static void EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl);
+static int EvdevSwitchMode(ClientPtr client, DeviceIntPtr device, int mode);
+static BOOL EvdevGrabDevice(InputInfoPtr pInfo, int grab, int ungrab);
+static void EvdevSetCalibration(InputInfoPtr pInfo, int num_calibration, int calibration[4]);
+static int EvdevOpenDevice(InputInfoPtr pInfo);
+
+static void EvdevInitAxesLabels(EvdevPtr pEvdev, int mode, int natoms, Atom *atoms);
+static void EvdevInitButtonLabels(EvdevPtr pEvdev, int natoms, Atom *atoms);
+static void EvdevInitProperty(DeviceIntPtr dev);
+static int EvdevSetProperty(DeviceIntPtr dev, Atom atom,
+                            XIPropertyValuePtr val, BOOL checkonly);
+#ifdef _F_GESTURE_EXTENSION_
+extern void mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e);
+static void EvdevMTSync(InputInfoPtr pInfo, MTSyncType sync);
+static BOOL EvdevMTStatusGet(InputInfoPtr pInfo, MTSyncType sync);
+#endif /* #ifdef _F_GESTURE_EXTENSION_ */
+#ifdef _F_TOUCH_TRANSFORM_MATRIX_
+static void EvdevSetTransformMatrix(InputInfoPtr pInfo, int num_transform, float *tmatrix);
+#endif /* #ifdef _F_TOUCH_TRANSFORM_MATRIX_ */
+#ifdef _F_EVDEV_CONFINE_REGION_
+Bool IsMaster(DeviceIntPtr dev);
+DeviceIntPtr GetPairedDevice(DeviceIntPtr dev);
+DeviceIntPtr GetMaster(DeviceIntPtr dev, int which);
+DeviceIntPtr GetMasterPointerFromId(int deviceid);
+static void EvdevHookPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox, BoxPtr pTopLeftBox);
+static void EvdevHookPointerConstrainCursor (DeviceIntPtr pDev, ScreenPtr pScreen, BoxPtr pBox);
+static void EvdevSetCursorLimits(InputInfoPtr pInfo, int region[6], int isSet);
+static void EvdevSetConfineRegion(InputInfoPtr pInfo, int num_item, int region[6]);
+#ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_
+static CARD32 EvdevRelativeMoveTimer(OsTimerPtr timer, CARD32 time, pointer arg);
+#endif /* #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_ */
+
+static Atom prop_confine_region = 0;
+#endif /* _F_EVDEV_CONFINE_REGION_ */
+static Atom prop_product_id;
+static Atom prop_invert;
+static Atom prop_calibration;
+static Atom prop_swap;
+static Atom prop_axis_label;
+static Atom prop_btn_label;
+static Atom prop_device;
+static Atom prop_virtual;
+#ifdef _F_ENABLE_DEVICE_TYPE_PROP_
+static Atom prop_device_type;
+#endif /* #ifdef _F_ENABLE_DEVICE_TYPE_PROP_ */
+#ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_
+static Atom prop_relative_move_status;
+static Atom prop_relative_move_ack;
+#endif /* #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_ */
+#ifdef _F_TOUCH_TRANSFORM_MATRIX_
+static Atom prop_transform;
+#endif /* #ifdef _F_TOUCH_TRANSFORM_MATRIX_ */
+
+/* All devices the evdev driver has allocated and knows about.
+ * MAXDEVICES is safe as null-terminated array, as two devices (VCP and VCK)
+ * cannot be used by evdev, leaving us with a space of 2 at the end. */
+static EvdevPtr evdev_devices[MAXDEVICES] = {NULL};
+
+static int EvdevSwitchMode(ClientPtr client, DeviceIntPtr device, int mode)
+{
+    InputInfoPtr pInfo;
+    EvdevPtr pEvdev;
+
+    pInfo = device->public.devicePrivate;
+    pEvdev = pInfo->private;
+
+    if (pEvdev->flags & EVDEV_RELATIVE_EVENTS)
+    {
+        if (mode == Relative)
+            return Success;
+        else
+            return XI_BadMode;
+    }
+
+    switch (mode) {
+        case Absolute:
+            pEvdev->flags &= ~EVDEV_RELATIVE_MODE;
+            break;
+
+        case Relative:
+            pEvdev->flags |= EVDEV_RELATIVE_MODE;
+            break;
+
+        default:
+            return XI_BadMode;
+    }
+
+    return Success;
+}
+
+static size_t EvdevCountBits(unsigned long *array, size_t nlongs)
+{
+    unsigned int i;
+    size_t count = 0;
+
+    for (i = 0; i < nlongs; i++) {
+        unsigned long x = array[i];
+
+        while (x > 0)
+        {
+            count += (x & 0x1);
+            x >>= 1;
+        }
+    }
+    return count;
+}
+
+static inline int EvdevBitIsSet(const unsigned long *array, int bit)
+{
+    return !!(array[bit / LONG_BITS] & (1LL << (bit % LONG_BITS)));
+}
+
+static inline void EvdevSetBit(unsigned long *array, int bit)
+{
+    array[bit / LONG_BITS] |= (1LL << (bit % LONG_BITS));
+}
+
+static int
+EvdevGetMajorMinor(InputInfoPtr pInfo)
+{
+    struct stat st;
+
+    if (fstat(pInfo->fd, &st) == -1)
+    {
+        xf86IDrvMsg(pInfo, X_ERROR, "stat failed (%s). cannot check for duplicates.\n",
+                    strerror(errno));
+        return 0;
+    }
+
+    return st.st_rdev;
+}
+
+/**
+ * Return TRUE if one of the devices we know about has the same min/maj
+ * number.
+ */
+static BOOL
+EvdevIsDuplicate(InputInfoPtr pInfo)
+{
+    EvdevPtr pEvdev = pInfo->private;
+    EvdevPtr* dev   = evdev_devices;
+
+    if (pEvdev->min_maj)
+    {
+        while(*dev)
+        {
+            if ((*dev) != pEvdev &&
+                (*dev)->min_maj &&
+                (*dev)->min_maj == pEvdev->min_maj)
+                return TRUE;
+            dev++;
+        }
+    }
+    return FALSE;
+}
+
+/**
+ * Add to internal device list.
+ */
+static void
+EvdevAddDevice(InputInfoPtr pInfo)
+{
+    EvdevPtr pEvdev = pInfo->private;
+    EvdevPtr* dev = evdev_devices;
+
+    while(*dev)
+        dev++;
+
+    *dev = pEvdev;
+}
+
+/**
+ * Remove from internal device list.
+ */
+static void
+EvdevRemoveDevice(InputInfoPtr pInfo)
+{
+    EvdevPtr pEvdev = pInfo->private;
+    EvdevPtr *dev   = evdev_devices;
+    int count       = 0;
+
+    while(*dev)
+    {
+        count++;
+        if (*dev == pEvdev)
+        {
+            memmove(dev, dev + 1,
+                    sizeof(evdev_devices) - (count * sizeof(EvdevPtr)));
+            break;
+        }
+        dev++;
+    }
+}
+
+
+static void
+SetXkbOption(InputInfoPtr pInfo, char *name, char **option)
+{
+    char *s;
+
+    if ((s = xf86SetStrOption(pInfo->options, name, NULL))) {
+        if (!s[0]) {
+            free(s);
+            *option = NULL;
+        } else {
+            *option = s;
+        }
+    }
+}
+
+static BOOL
+EvdevDeviceIsVirtual(const char* devicenode)
+{
+    struct udev *udev = NULL;
+    struct udev_device *device = NULL;
+    struct stat st;
+    int rc = FALSE;
+    const char *devpath;
+
+    udev = udev_new();
+    if (!udev)
+        goto out;
+
+    stat(devicenode, &st);
+    device = udev_device_new_from_devnum(udev, 'c', st.st_rdev);
+
+    if (!device)
+        goto out;
+
+
+    devpath = udev_device_get_devpath(device);
+    if (!devpath)
+        goto out;
+
+    if (strstr(devpath, "LNXSYSTM"))
+        rc = TRUE;
+
+out:
+    udev_device_unref(device);
+    udev_unref(udev);
+    return rc;
+}
+
+#ifndef HAVE_SMOOTH_SCROLLING
+static int wheel_up_button = 4;
+static int wheel_down_button = 5;
+static int wheel_left_button = 6;
+static int wheel_right_button = 7;
+#endif
+
+static EventQueuePtr
+EvdevNextInQueue(InputInfoPtr pInfo)
+{
+    EvdevPtr pEvdev = pInfo->private;
+
+    if (pEvdev->num_queue >= EVDEV_MAXQUEUE)
+    {
+        xf86IDrvMsg(pInfo, X_NONE, "dropping event due to full queue!\n");
+        return NULL;
+    }
+
+    pEvdev->num_queue++;
+    return &pEvdev->queue[pEvdev->num_queue - 1];
+}
+
+void
+EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value)
+{
+    int code = ev->code + MIN_KEYCODE;
+    EventQueuePtr pQueue;
+
+    /* Filter all repeated events from device.
+       We'll do softrepeat in the server, but only since 1.6 */
+    if (value == 2)
+        return;
+
+    if ((pQueue = EvdevNextInQueue(pInfo)))
+    {
+        pQueue->type = EV_QUEUE_KEY;
+        pQueue->detail.key = code;
+        pQueue->val = value;
+    }
+}
+
+void
+EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value)
+{
+    EventQueuePtr pQueue;
+
+    if ((pQueue = EvdevNextInQueue(pInfo)))
+    {
+        pQueue->type = EV_QUEUE_BTN;
+        pQueue->detail.key = button;
+        pQueue->val = value;
+    }
+}
+
+void
+EvdevQueueProximityEvent(InputInfoPtr pInfo, int value)
+{
+    EventQueuePtr pQueue;
+    if ((pQueue = EvdevNextInQueue(pInfo)))
+    {
+        pQueue->type = EV_QUEUE_PROXIMITY;
+        pQueue->detail.key = 0;
+        pQueue->val = value;
+    }
+}
+
+#ifdef MULTITOUCH
+void
+EvdevQueueTouchEvent(InputInfoPtr pInfo, unsigned int touch, ValuatorMask *mask,
+                     uint16_t evtype)
+{
+    EventQueuePtr pQueue;
+    if ((pQueue = EvdevNextInQueue(pInfo)))
+    {
+        pQueue->type = EV_QUEUE_TOUCH;
+        pQueue->detail.touch = touch;
+        valuator_mask_copy(pQueue->touchMask, mask);
+        pQueue->val = evtype;
+    }
+}
+#endif
+
+/**
+ * Post button event right here, right now.
+ * Interface for MB emulation since these need to post immediately.
+ */
+void
+EvdevPostButtonEvent(InputInfoPtr pInfo, int button, enum ButtonAction act)
+{
+    xf86PostButtonEvent(pInfo->dev, Relative, button,
+                        (act == BUTTON_PRESS) ? 1 : 0, 0, 0);
+}
+
+void
+EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count)
+{
+    int i;
+
+    for (i = 0; i < count; i++) {
+        EvdevQueueButtonEvent(pInfo, button, 1);
+        EvdevQueueButtonEvent(pInfo, button, 0);
+    }
+}
+
+/**
+ * Take the valuators and process them accordingly.
+ */
+static void
+EvdevProcessValuators(InputInfoPtr pInfo)
+{
+    int tmp;
+    EvdevPtr pEvdev = pInfo->private;
+    int *delta = pEvdev->delta;
+
+    /* convert to relative motion for touchpads */
+    if (pEvdev->abs_queued && (pEvdev->flags & EVDEV_RELATIVE_MODE)) {
+        if (pEvdev->in_proximity) {
+            if (valuator_mask_isset(pEvdev->vals, 0))
+            {
+                if (valuator_mask_isset(pEvdev->old_vals, 0))
+                    delta[REL_X] = valuator_mask_get(pEvdev->vals, 0) -
+                                   valuator_mask_get(pEvdev->old_vals, 0);
+                valuator_mask_set(pEvdev->old_vals, 0,
+                                  valuator_mask_get(pEvdev->vals, 0));
+            }
+            if (valuator_mask_isset(pEvdev->vals, 1))
+            {
+                if (valuator_mask_isset(pEvdev->old_vals, 1))
+                    delta[REL_Y] = valuator_mask_get(pEvdev->vals, 1) -
+                                   valuator_mask_get(pEvdev->old_vals, 1);
+                valuator_mask_set(pEvdev->old_vals, 1,
+                                  valuator_mask_get(pEvdev->vals, 1));
+            }
+        } else {
+            valuator_mask_zero(pEvdev->old_vals);
+        }
+        valuator_mask_zero(pEvdev->vals);
+        pEvdev->abs_queued = 0;
+        pEvdev->rel_queued = 1;
+    }
+
+    if (pEvdev->rel_queued) {
+        int i;
+
+        if (pEvdev->swap_axes) {
+            tmp = pEvdev->delta[REL_X];
+            pEvdev->delta[REL_X] = pEvdev->delta[REL_Y];
+            pEvdev->delta[REL_Y] = tmp;
+            if (pEvdev->delta[REL_X] == 0)
+                valuator_mask_unset(pEvdev->vals, REL_X);
+            if (pEvdev->delta[REL_Y] == 0)
+                valuator_mask_unset(pEvdev->vals, REL_Y);
+        }
+        if (pEvdev->invert_x)
+            pEvdev->delta[REL_X] *= -1;
+        if (pEvdev->invert_y)
+            pEvdev->delta[REL_Y] *= -1;
+
+
+        Evdev3BEmuProcessRelMotion(pInfo,
+                                   pEvdev->delta[REL_X],
+                                   pEvdev->delta[REL_Y]);
+
+        for (i = 0; i < REL_CNT; i++)
+        {
+            int map = pEvdev->axis_map[i];
+            if (pEvdev->delta[i] && map != -1)
+                valuator_mask_set(pEvdev->vals, map, pEvdev->delta[i]);
+        }
+    }
+    /*
+     * Some devices only generate valid abs coords when BTN_TOOL_PEN is
+     * pressed.  On wacom tablets, this means that the pen is in
+     * proximity of the tablet.  After the pen is removed, BTN_TOOL_PEN is
+     * released, and a (0, 0) absolute event is generated.  Checking
+     * pEvdev->in_proximity here lets us ignore that event.  pEvdev is
+     * initialized to 1 so devices that don't use this scheme still
+     * just works.
+     */
+    else if (pEvdev->abs_queued && pEvdev->in_proximity) {
+        int i;
+
+        if (pEvdev->swap_axes) {
+            int swapped_isset[2] = {0, 0};
+            int swapped_values[2];
+
+            for(i = 0; i <= 1; i++)
+                if (valuator_mask_isset(pEvdev->vals, i)) {
+                    swapped_isset[1 - i] = 1;
+                    swapped_values[1 - i] =
+                        xf86ScaleAxis(valuator_mask_get(pEvdev->vals, i),
+                                      pEvdev->absinfo[1 - i].maximum,
+                                      pEvdev->absinfo[1 - i].minimum,
+                                      pEvdev->absinfo[i].maximum,
+                                      pEvdev->absinfo[i].minimum);
+                }
+
+            for (i = 0; i <= 1; i++)
+                if (swapped_isset[i])
+                    valuator_mask_set(pEvdev->vals, i, swapped_values[i]);
+                else
+                    valuator_mask_unset(pEvdev->vals, i);
+        }
+
+        for (i = 0; i <= 1; i++) {
+            int val;
+            int calib_min;
+            int calib_max;
+
+            if (!valuator_mask_isset(pEvdev->vals, i))
+                continue;
+
+            val = valuator_mask_get(pEvdev->vals, i);
+
+            if (i == 0) {
+                calib_min = pEvdev->calibration.min_x;
+                calib_max = pEvdev->calibration.max_x;
+            } else {
+                calib_min = pEvdev->calibration.min_y;
+                calib_max = pEvdev->calibration.max_y;
+            }
+
+            if (pEvdev->flags & EVDEV_CALIBRATED)
+                val = xf86ScaleAxis(val, pEvdev->absinfo[i].maximum,
+                                    pEvdev->absinfo[i].minimum, calib_max,
+                                    calib_min);
+
+            if ((i == 0 && pEvdev->invert_x) || (i == 1 && pEvdev->invert_y))
+                val = (pEvdev->absinfo[i].maximum - val +
+                       pEvdev->absinfo[i].minimum);
+
+            valuator_mask_set(pEvdev->vals, i, val);
+        }
+        Evdev3BEmuProcessAbsMotion(pInfo, pEvdev->vals);
+    }
+}
+
+static void
+EvdevProcessProximityEvent(InputInfoPtr pInfo, struct input_event *ev)
+{
+    EvdevPtr pEvdev = pInfo->private;
+
+    if (!pEvdev->use_proximity)
+        return;
+
+    pEvdev->prox_queued = 1;
+
+    EvdevQueueProximityEvent(pInfo, ev->value);
+}
+
+/**
+ * Proximity handling is rather weird because of tablet-specific issues.
+ * Some tablets, notably Wacoms, send a 0/0 coordinate in the same EV_SYN as
+ * the out-of-proximity notify. We need to ignore those, hence we only
+ * actually post valuator events when we're in proximity.
+ *
+ * Other tablets send the x/y coordinates, then EV_SYN, then the proximity
+ * event. For those, we need to remember x/y to post it when the proximity
+ * comes.
+ *
+ * If we're not in proximity and we get valuator events, remember that, they
+ * won't be posted though. If we move into proximity without valuators, use
+ * the last ones we got and let the rest of the code post them.
+ */
+static int
+EvdevProcessProximityState(InputInfoPtr pInfo)
+{
+    EvdevPtr pEvdev = pInfo->private;
+    int prox_state = 0;
+    int i;
+
+    /* Does this device have any proximity axes? */
+    if (!pEvdev->prox)
+        return 0;
+
+    /* no proximity change in the queue */
+    if (!pEvdev->prox_queued)
+    {
+        if (pEvdev->abs_queued && !pEvdev->in_proximity)
+            for (i = 0; i < valuator_mask_size(pEvdev->vals); i++)
+                if (valuator_mask_isset(pEvdev->vals, i))
+                    valuator_mask_set(pEvdev->prox, i,
+                                      valuator_mask_get(pEvdev->vals, i));
+        return 0;
+    }
+
+    for (i = 0; i < pEvdev->num_queue; i++)
+    {
+        if (pEvdev->queue[i].type == EV_QUEUE_PROXIMITY)
+        {
+            prox_state = pEvdev->queue[i].val;
+            break;
+        }
+    }
+
+    if ((prox_state && !pEvdev->in_proximity) ||
+        (!prox_state && pEvdev->in_proximity))
+    {
+        /* We're about to go into/out of proximity but have no abs events
+         * within the EV_SYN. Use the last coordinates we have. */
+        for (i = 0; i < valuator_mask_size(pEvdev->prox); i++)
+            if (!valuator_mask_isset(pEvdev->vals, i) &&
+                valuator_mask_isset(pEvdev->prox, i))
+                valuator_mask_set(pEvdev->vals, i,
+                                  valuator_mask_get(pEvdev->prox, i));
+        valuator_mask_zero(pEvdev->prox);
+
+        pEvdev->abs_queued = valuator_mask_size(pEvdev->vals);
+    }
+
+    pEvdev->in_proximity = prox_state;
+    return 1;
+}
+
+/**
+ * Take a button input event and process it accordingly.
+ */
+static void
+EvdevProcessButtonEvent(InputInfoPtr pInfo, struct input_event *ev)
+{
+    unsigned int button;
+    int value;
+    EvdevPtr pEvdev = pInfo->private;
+
+    button = EvdevUtilButtonEventToButtonNumber(pEvdev, ev->code);
+
+    /* Get the signed value, earlier kernels had this as unsigned */
+    value = ev->value;
+
+    /* Handle drag lock */
+    if (EvdevDragLockFilterEvent(pInfo, button, value))
+        return;
+
+    if (EvdevWheelEmuFilterButton(pInfo, button, value))
+        return;
+
+    if (EvdevMBEmuFilterEvent(pInfo, button, value))
+        return;
+
+    if (button)
+        EvdevQueueButtonEvent(pInfo, button, value);
+    else
+        EvdevQueueKbdEvent(pInfo, ev, value);
+}
+
+/**
+ * Take the relative motion input event and process it accordingly.
+ */
+static void
+EvdevProcessRelativeMotionEvent(InputInfoPtr pInfo, struct input_event *ev)
+{
+    int value;
+    EvdevPtr pEvdev = pInfo->private;
+    int map;
+
+    /* Get the signed value, earlier kernels had this as unsigned */
+    value = ev->value;
+
+    switch (ev->code) {
+#ifndef HAVE_SMOOTH_SCROLLING
+        case REL_WHEEL:
+            if (value > 0)
+                EvdevQueueButtonClicks(pInfo, wheel_up_button, value);
+            else if (value < 0)
+                EvdevQueueButtonClicks(pInfo, wheel_down_button, -value);
+            break;
+
+        case REL_DIAL:
+        case REL_HWHEEL:
+            if (value > 0)
+                EvdevQueueButtonClicks(pInfo, wheel_right_button, value);
+            else if (value < 0)
+                EvdevQueueButtonClicks(pInfo, wheel_left_button, -value);
+            break;
+        /* We don't post wheel events as axis motion. */
+#endif
+        default:
+            /* Ignore EV_REL events if we never set up for them. */
+            if (!(pEvdev->flags & EVDEV_RELATIVE_EVENTS))
+                return;
+
+            /* Handle mouse wheel emulation */
+            if (EvdevWheelEmuFilterMotion(pInfo, ev))
+                return;
+
+            pEvdev->rel_queued = 1;
+            pEvdev->delta[ev->code] += value;
+            map = pEvdev->axis_map[ev->code];
+            valuator_mask_set(pEvdev->vals, map, value);
+            break;
+    }
+}
+
+#ifdef MULTITOUCH
+static void
+EvdevProcessTouch(InputInfoPtr pInfo)
+{
+    EvdevPtr pEvdev = pInfo->private;
+    int type;
+
+    if (pEvdev->cur_slot < 0 || !pEvdev->mt_mask)
+        return;
+
+    /* If the ABS_MT_SLOT is the first event we get after EV_SYN, skip this */
+    if (pEvdev->slot_state == SLOTSTATE_EMPTY)
+        return;
+
+    if (pEvdev->slot_state == SLOTSTATE_CLOSE)
+        type = XI_TouchEnd;
+    else if (pEvdev->slot_state == SLOTSTATE_OPEN)
+        type = XI_TouchBegin;
+    else
+        type = XI_TouchUpdate;
+
+
+    EvdevQueueTouchEvent(pInfo, pEvdev->cur_slot, pEvdev->mt_mask, type);
+
+    pEvdev->slot_state = SLOTSTATE_EMPTY;
+
+    valuator_mask_zero(pEvdev->mt_mask);
+}
+
+static int
+num_slots(EvdevPtr pEvdev)
+{
+    int value = pEvdev->absinfo[ABS_MT_SLOT].maximum -
+                pEvdev->absinfo[ABS_MT_SLOT].minimum + 1;
+
+    /* If we don't know how many slots there are, assume at least 10 */
+    return value > 1 ? value : 10;
+}
+
+static int
+last_mt_vals_slot(EvdevPtr pEvdev)
+{
+    int value = pEvdev->cur_slot - pEvdev->absinfo[ABS_MT_SLOT].minimum;
+
+    return value < num_slots(pEvdev) ? value : -1;
+}
+
+static void
+EvdevProcessTouchEvent(InputInfoPtr pInfo, struct input_event *ev)
+{
+    EvdevPtr pEvdev = pInfo->private;
+    int map;
+
+    if (ev->code == ABS_MT_SLOT) {
+        EvdevProcessTouch(pInfo);
+        pEvdev->cur_slot = ev->value;
+    } else
+    {
+        int slot_index = last_mt_vals_slot(pEvdev);
+
+        if (pEvdev->slot_state == SLOTSTATE_EMPTY)
+            pEvdev->slot_state = SLOTSTATE_UPDATE;
+        if (ev->code == ABS_MT_TRACKING_ID) {
+            if (ev->value >= 0) {
+                pEvdev->slot_state = SLOTSTATE_OPEN;
+
+                if (slot_index >= 0)
+                    valuator_mask_copy(pEvdev->mt_mask,
+                                       pEvdev->last_mt_vals[slot_index]);
+                else
+                    xf86IDrvMsg(pInfo, X_WARNING,
+                                "Attempted to copy values from out-of-range "
+                                "slot, touch events may be incorrect.\n");
+            } else
+                pEvdev->slot_state = SLOTSTATE_CLOSE;
+        } else {
+            map = pEvdev->axis_map[ev->code];
+            valuator_mask_set(pEvdev->mt_mask, map, ev->value);
+            if (slot_index >= 0)
+                valuator_mask_set(pEvdev->last_mt_vals[slot_index], map,
+                                  ev->value);
+        }
+    }
+}
+#else
+#define EvdevProcessTouch(pInfo)
+#define EvdevProcessTouchEvent(pInfo, ev)
+#endif /* MULTITOUCH */
+
+/**
+ * Take the absolute motion input event and process it accordingly.
+ */
+static void
+EvdevProcessAbsoluteMotionEvent(InputInfoPtr pInfo, struct input_event *ev)
+{
+    int value;
+    EvdevPtr pEvdev = pInfo->private;
+    int map;
+
+    /* Get the signed value, earlier kernels had this as unsigned */
+    value = ev->value;
+
+    /* Ignore EV_ABS events if we never set up for them. */
+    if (!(pEvdev->flags & EVDEV_ABSOLUTE_EVENTS))
+        return;
+
+    if (ev->code > ABS_MAX)
+        return;
+
+    if (EvdevWheelEmuFilterMotion(pInfo, ev))
+        return;
+
+    if (ev->code >= ABS_MT_SLOT) {
+        EvdevProcessTouchEvent(pInfo, ev);
+        pEvdev->abs_queued = 1;
+    } else if (!pEvdev->mt_mask) {
+        map = pEvdev->axis_map[ev->code];
+
+       if(map < 0)
+       {
+               xf86IDrvMsg(pInfo, X_INFO, "[EvdevProcessAbsoluteMotionEvent] Invalid valuator (=%d), value=%d\nThis is going to be skipped.", map, value);
+               return;
+       }
+
+        valuator_mask_set(pEvdev->vals, map, value);
+        pEvdev->abs_queued = 1;
+    }
+}
+
+/**
+ * Take the key press/release input event and process it accordingly.
+ */
+static void
+EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev)
+{
+    int value, i;
+    EvdevPtr pEvdev = pInfo->private;
+
+    /* Get the signed value, earlier kernels had this as unsigned */
+    value = ev->value;
+
+    /* don't repeat mouse buttons */
+    if (ev->code >= BTN_MOUSE && ev->code < KEY_OK)
+        if (value == 2)
+            return;
+
+    for (i = 0; i < ArrayLength(proximity_bits); i++)
+    {
+        if (ev->code == proximity_bits[i])
+        {
+            EvdevProcessProximityEvent(pInfo, ev);
+            return;
+        }
+    }
+
+    switch (ev->code) {
+        case BTN_TOUCH:
+            /* For devices that have but don't use proximity, use
+             * BTN_TOUCH as the proximity notifier */
+            if (!pEvdev->use_proximity)
+                pEvdev->in_proximity = value ? ev->code : 0;
+            if (!(pEvdev->flags & (EVDEV_TOUCHSCREEN | EVDEV_TABLET)) ||
+                pEvdev->mt_mask)
+                break;
+            /* Treat BTN_TOUCH from devices that only have BTN_TOUCH as
+             * BTN_LEFT. */
+            ev->code = BTN_LEFT;
+            /* Intentional fallthrough! */
+
+        default:
+            EvdevProcessButtonEvent(pInfo, ev);
+            break;
+    }
+}
+
+#ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_
+static CARD32
+EvdevRelativeMoveTimer(OsTimerPtr timer, CARD32 time, pointer arg)
+{
+    InputInfoPtr pInfo = (InputInfoPtr)arg;
+    EvdevPtr pEvdev;
+
+    if(pInfo) pEvdev = pInfo->private;
+    else return 0;
+
+    if(!pEvdev) return 0;
+    if(pEvdev->rel_move_timer)
+        TimerCancel(pEvdev->rel_move_timer);
+    pEvdev->rel_move_timer = NULL;
+
+    pEvdev->rel_move_status = 0;
+    pEvdev->rel_move_ack = 0;
+    int rc = XIDeleteDeviceProperty(pInfo->dev, prop_relative_move_status, TRUE);
+
+    if (rc != Success)
+    {
+        xf86IDrvMsg(pInfo, X_ERROR, "[%s] Failed to delete device property (id:%d, prop=%d)\n", __FUNCTION__, pInfo->dev->id, prop_relative_move_status);
+    }
+
+    ErrorF("[%s] pEvdev->rel_move_status=%d\n", __FUNCTION__, pEvdev->rel_move_status);
+
+    return 0;
+}
+#endif /* #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_ */
+
+#ifdef _F_GESTURE_EXTENSION_
+static BOOL EvdevMTStatusGet(InputInfoPtr pInfo, MTSyncType sync)
+{
+    int i;
+    static int nslots;
+    int pressed = 0;
+    const int first_press = XI_TouchEnd - XI_TouchBegin;
+    EvdevPtr pEvdev = pInfo->private;
+
+    if (!pEvdev || !pEvdev->mt_status )
+        return FALSE;
+
+    nslots = num_slots(pEvdev);
+    for(i = 0; i < nslots; i++)
+    {
+        pressed += pEvdev->mt_status[i];
+
+        if (pressed > first_press)
+               return FALSE;
+    }
+
+    if ((sync == MTOUCH_FRAME_SYNC_BEGIN) && (pressed == first_press))
+        return TRUE;
+
+    if ((sync == MTOUCH_FRAME_SYNC_END) && !pressed)
+        return TRUE;
+
+    return FALSE;
+}
+
+static void EvdevMTSync(InputInfoPtr pInfo, MTSyncType sync)
+{
+       AnyEvent event;
+
+       memset(&event, 0, sizeof(event));
+       event.header = ET_Internal;
+       event.type = ET_MTSync;
+       event.length = sizeof(event);
+       event.time = GetTimeInMillis();
+       event.deviceid = pInfo->dev->id;
+       event.sync = sync;
+
+       mieqEnqueue (pInfo->dev, (InternalEvent*)&event);
+
+#ifdef __MTSYNC_DEBUG__
+       xf86IDrvMsg(pInfo, X_INFO, "[EvdevMTSync] %s has been sent !\n",
+               (sync==MTOUCH_FRAME_SYNC_BEGIN) ? "MTOUCH_FRAME_SYNC_BEGIN" : "MTOUCH_FRAME_SYNC_END");
+#endif /* #ifdef __MTSYNC_DEBUG__ */
+}
+#endif /* #ifdef _F_GESTURE_EXTENSION_ */
+
+/**
+ * Post the relative motion events.
+ */
+void
+EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
+                              int v[MAX_VALUATORS])
+{
+    EvdevPtr pEvdev = pInfo->private;
+
+    if (pEvdev->rel_queued) {
+#ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_
+       if(!pEvdev->rel_move_prop_set)
+               pEvdev->rel_move_prop_set = 1;
+
+       if(!pEvdev->rel_move_status || !pEvdev->rel_move_ack)
+       {
+               pEvdev->rel_move_status = 1;
+               int rc = XIChangeDeviceProperty(pInfo->dev, prop_relative_move_status, XA_INTEGER, 8,
+                               PropModeReplace, 1, &pEvdev->rel_move_status, TRUE);
+               
+               if (rc != Success)
+               {
+                       xf86IDrvMsg(pInfo, X_ERROR, "[%s] Failed to change device property (id:%d, prop=%d)\n", __FUNCTION__, pInfo->dev->id, prop_relative_move_status);
+               }
+       }
+
+       TimerCancel(pEvdev->rel_move_timer);
+       pEvdev->rel_move_timer = NULL;
+       pEvdev->rel_move_timer = TimerSet(pEvdev->rel_move_timer, 0, 15000, EvdevRelativeMoveTimer, pInfo);
+#endif /* #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_ */
+        xf86PostMotionEventM(pInfo->dev, Relative, pEvdev->vals);
+    }
+}
+
+/**
+ * Post the absolute motion events.
+ */
+void
+EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
+                              int v[MAX_VALUATORS])
+{
+    EvdevPtr pEvdev = pInfo->private;
+
+    /*
+     * Some devices only generate valid abs coords when BTN_TOOL_PEN is
+     * pressed.  On wacom tablets, this means that the pen is in
+     * proximity of the tablet.  After the pen is removed, BTN_TOOL_PEN is
+     * released, and a (0, 0) absolute event is generated.  Checking
+     * pEvdev->in_proximity here lets us ignore that event.
+     * pEvdev->in_proximity is initialized to 1 so devices that don't use
+     * this scheme still just work.
+     */
+    if (pEvdev->abs_queued && pEvdev->in_proximity) {
+        xf86PostMotionEventM(pInfo->dev, Absolute, pEvdev->vals);
+    }
+}
+
+static void
+EvdevPostProximityEvents(InputInfoPtr pInfo, int which, int num_v, int first_v,
+                                  int v[MAX_VALUATORS])
+{
+    int i;
+    EvdevPtr pEvdev = pInfo->private;
+
+    for (i = 0; pEvdev->prox_queued && i < pEvdev->num_queue; i++) {
+        switch (pEvdev->queue[i].type) {
+            case EV_QUEUE_KEY:
+            case EV_QUEUE_BTN:
+#ifdef MULTITOUCH
+            case EV_QUEUE_TOUCH:
+#endif
+                break;
+            case EV_QUEUE_PROXIMITY:
+                if (pEvdev->queue[i].val == which)
+                    xf86PostProximityEventP(pInfo->dev, which, first_v, num_v,
+                            v + first_v);
+                break;
+        }
+    }
+}
+
+/**
+ * Post the queued key/button events.
+ */
+static void EvdevPostQueuedEvents(InputInfoPtr pInfo, int num_v, int first_v,
+                                  int v[MAX_VALUATORS])
+{
+    int i;
+#ifdef _F_GESTURE_EXTENSION_
+    int sync_value;
+    int event_type;
+    int slot_idx;
+    int pressed = 0;
+#endif /* #ifdef _F_GESTURE_EXTENSION_ */
+#ifdef _F_TOUCH_TRANSFORM_MATRIX_
+    pixman_vector_t p;
+    static int lastx;
+    static int lasty;
+#endif /* #ifdef _F_TOUCH_TRANSFORM_MATRIX_ */
+
+    EvdevPtr pEvdev = pInfo->private;
+
+    for (i = 0; i < pEvdev->num_queue; i++) {
+        switch (pEvdev->queue[i].type) {
+        case EV_QUEUE_KEY:
+            xf86PostKeyboardEvent(pInfo->dev, pEvdev->queue[i].detail.key,
+                                  pEvdev->queue[i].val);
+            break;
+        case EV_QUEUE_BTN:
+            if (Evdev3BEmuFilterEvent(pInfo,
+                                      pEvdev->queue[i].detail.key,
+                                      pEvdev->queue[i].val))
+                break;
+
+            if (pEvdev->abs_queued && pEvdev->in_proximity) {
+                xf86PostButtonEventP(pInfo->dev, Absolute, pEvdev->queue[i].detail.key,
+                                     pEvdev->queue[i].val, first_v, num_v,
+                                     v + first_v);
+
+            } else
+                xf86PostButtonEvent(pInfo->dev, Relative, pEvdev->queue[i].detail.key,
+                                    pEvdev->queue[i].val, 0, 0);
+            break;
+        case EV_QUEUE_PROXIMITY:
+            break;
+#ifdef MULTITOUCH
+        case EV_QUEUE_TOUCH:
+#ifdef _F_TOUCH_TRANSFORM_MATRIX_
+            if( pEvdev->use_transform )
+            {
+                int x, y, slot;
+
+                x = valuator_mask_get(pEvdev->queue[i].touchMask, 0);
+                y = valuator_mask_get(pEvdev->queue[i].touchMask, 1);
+
+                if(x || y)
+                {
+                       slot = pEvdev->queue[i].detail.touch;
+                       x = valuator_mask_get(pEvdev->last_mt_vals[slot], 0);
+                       y = valuator_mask_get(pEvdev->last_mt_vals[slot], 1);
+
+                       p.vector[0] = pixman_int_to_fixed(x);
+                       p.vector[1] = pixman_int_to_fixed(y);
+                       p.vector[2] = pixman_int_to_fixed(1);
+                                       
+                       pixman_transform_point(&pEvdev->inv_transform, &p);
+                                       
+                       valuator_mask_set(pEvdev->queue[i].touchMask, 0, pixman_fixed_to_int(p.vector[0]));
+                       valuator_mask_set(pEvdev->queue[i].touchMask, 1, pixman_fixed_to_int(p.vector[1]));
+                }
+            }
+#endif /* #ifdef _F_TOUCH_TRANSFORM_MATRIX_ */
+#ifdef _F_GESTURE_EXTENSION_
+            sync_value = -1;
+            event_type = pEvdev->queue[i].val;
+            slot_idx = pEvdev->queue[i].detail.touch;
+
+            if (pEvdev->mt_status)
+            {
+                pEvdev->mt_status[slot_idx] = XI_TouchEnd - event_type;
+
+                if ((XI_TouchBegin == event_type) && (slot_idx == 0))
+                {
+                       if (EvdevMTStatusGet(pInfo, MTOUCH_FRAME_SYNC_BEGIN))
+                       {
+                               sync_value = MTOUCH_FRAME_SYNC_BEGIN;
+                               EvdevMTSync(pInfo, MTOUCH_FRAME_SYNC_BEGIN);
+                       }
+                }
+
+                xf86PostTouchEvent(pInfo->dev, slot_idx,
+                               event_type, 0,
+                               pEvdev->queue[i].touchMask);
+
+                if ((sync_value < 0) && (XI_TouchEnd == event_type))
+                {
+                       if (EvdevMTStatusGet(pInfo, MTOUCH_FRAME_SYNC_END))
+                       {
+                               EvdevMTSync(pInfo, MTOUCH_FRAME_SYNC_END);
+                       }
+                }
+            }
+#else /* #ifdef _F_GESTURE_EXTENSION_ */
+            xf86PostTouchEvent(pInfo->dev, pEvdev->queue[i].detail.touch,
+                               pEvdev->queue[i].val, 0,
+                               pEvdev->queue[i].touchMask);
+#endif /* #ifdef _F_GESTURE_EXTENSION_ */
+            break;
+#endif
+        }
+    }
+}
+
+/**
+ * Take the synchronization input event and process it accordingly; the motion
+ * notify events are sent first, then any button/key press/release events.
+ */
+static void
+EvdevProcessSyncEvent(InputInfoPtr pInfo, struct input_event *ev)
+{
+    int i;
+    int num_v = 0, first_v = 0;
+    int v[MAX_VALUATORS] = {};
+    EvdevPtr pEvdev = pInfo->private;
+
+    EvdevProcessProximityState(pInfo);
+
+    EvdevProcessValuators(pInfo);
+    EvdevProcessTouch(pInfo);
+
+    EvdevPostProximityEvents(pInfo, TRUE, num_v, first_v, v);
+    EvdevPostRelativeMotionEvents(pInfo, num_v, first_v, v);
+    EvdevPostAbsoluteMotionEvents(pInfo, num_v, first_v, v);
+    EvdevPostQueuedEvents(pInfo, num_v, first_v, v);
+    EvdevPostProximityEvents(pInfo, FALSE, num_v, first_v, v);
+
+    memset(pEvdev->delta, 0, sizeof(pEvdev->delta));
+    for (i = 0; i < ArrayLength(pEvdev->queue); i++)
+    {
+        EventQueuePtr queue = &pEvdev->queue[i];
+        queue->detail.key = 0;
+        queue->type = 0;
+        queue->val = 0;
+        /* don't reset the touchMask */
+    }
+
+    if (pEvdev->vals)
+        valuator_mask_zero(pEvdev->vals);
+    pEvdev->num_queue = 0;
+    pEvdev->abs_queued = 0;
+    pEvdev->rel_queued = 0;
+    pEvdev->prox_queued = 0;
+
+}
+
+/**
+ * Process the events from the device; nothing is actually posted to the server
+ * until an EV_SYN event is received.
+ */
+static void
+EvdevProcessEvent(InputInfoPtr pInfo, struct input_event *ev)
+{
+    switch (ev->type) {
+        case EV_REL:
+            EvdevProcessRelativeMotionEvent(pInfo, ev);
+            break;
+        case EV_ABS:
+            EvdevProcessAbsoluteMotionEvent(pInfo, ev);
+            break;
+        case EV_KEY:
+            EvdevProcessKeyEvent(pInfo, ev);
+            break;
+        case EV_SYN:
+            EvdevProcessSyncEvent(pInfo, ev);
+            break;
+    }
+}
+
+#undef ABS_X_VALUE
+#undef ABS_Y_VALUE
+#undef ABS_VALUE
+
+static void
+EvdevFreeMasks(EvdevPtr pEvdev)
+{
+    int i;
+
+    valuator_mask_free(&pEvdev->vals);
+    valuator_mask_free(&pEvdev->old_vals);
+    valuator_mask_free(&pEvdev->prox);
+#ifdef MULTITOUCH
+    valuator_mask_free(&pEvdev->mt_mask);
+    if (pEvdev->last_mt_vals)
+    {
+        for (i = 0; i < num_slots(pEvdev); i++)
+            valuator_mask_free(&pEvdev->last_mt_vals[i]);
+        free(pEvdev->last_mt_vals);
+        pEvdev->last_mt_vals = NULL;
+    }
+    for (i = 0; i < EVDEV_MAXQUEUE; i++)
+        valuator_mask_free(&pEvdev->queue[i].touchMask);
+#endif
+}
+
+/* just a magic number to reduce the number of reads */
+#define NUM_EVENTS 16
+
+static void
+EvdevReadInput(InputInfoPtr pInfo)
+{
+    struct input_event ev[NUM_EVENTS];
+    int i, len = sizeof(ev);
+
+    while (len == sizeof(ev))
+    {
+#ifdef MULTITOUCH
+        EvdevPtr pEvdev = pInfo->private;
+
+        if (pEvdev->mtdev)
+            len = mtdev_get(pEvdev->mtdev, pInfo->fd, ev, NUM_EVENTS) *
+                sizeof(struct input_event);
+        else
+#endif
+            len = read(pInfo->fd, &ev, sizeof(ev));
+
+        if (len <= 0)
+        {
+            if (errno == ENODEV) /* May happen after resume */
+            {
+                EvdevMBEmuFinalize(pInfo);
+                Evdev3BEmuFinalize(pInfo);
+                xf86RemoveEnabledDevice(pInfo);
+                close(pInfo->fd);
+                pInfo->fd = -1;
+            } else if (errno != EAGAIN)
+            {
+                /* We use X_NONE here because it doesn't alloc */
+                xf86MsgVerb(X_NONE, 0, "%s: Read error: %s\n", pInfo->name,
+                        strerror(errno));
+            }
+            break;
+        }
+
+        /* The kernel promises that we always only read a complete
+         * event, so len != sizeof ev is an error. */
+        if (len % sizeof(ev[0])) {
+            /* We use X_NONE here because it doesn't alloc */
+            xf86MsgVerb(X_NONE, 0, "%s: Read error: %s\n", pInfo->name, strerror(errno));
+            break;
+        }
+
+        for (i = 0; i < len/sizeof(ev[0]); i++)
+            EvdevProcessEvent(pInfo, &ev[i]);
+    }
+}
+
+static void
+EvdevPtrCtrlProc(DeviceIntPtr device, PtrCtrl *ctrl)
+{
+    /* Nothing to do, dix handles all settings */
+}
+
+static void
+EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl)
+{
+    static struct { int xbit, code; } bits[] = {
+        { CAPSFLAG,    LED_CAPSL },
+        { NUMFLAG,     LED_NUML },
+        { SCROLLFLAG,  LED_SCROLLL },
+        { MODEFLAG,    LED_KANA },
+        { COMPOSEFLAG, LED_COMPOSE }
+    };
+
+    InputInfoPtr pInfo;
+    struct input_event ev[ArrayLength(bits)];
+    int i;
+
+    memset(ev, 0, sizeof(ev));
+
+    pInfo = device->public.devicePrivate;
+    for (i = 0; i < ArrayLength(bits); i++) {
+        ev[i].type = EV_LED;
+        ev[i].code = bits[i].code;
+        ev[i].value = (ctrl->leds & bits[i].xbit) > 0;
+    }
+
+    write(pInfo->fd, ev, sizeof ev);
+}
+
+static int
+EvdevAddKeyClass(DeviceIntPtr device)
+{
+    InputInfoPtr pInfo;
+    EvdevPtr pEvdev;
+
+    pInfo = device->public.devicePrivate;
+    pEvdev = pInfo->private;
+
+    /* sorry, no rules change allowed for you */
+    xf86ReplaceStrOption(pInfo->options, "xkb_rules", "evdev");
+    SetXkbOption(pInfo, "xkb_rules", &pEvdev->rmlvo.rules);
+    SetXkbOption(pInfo, "xkb_model", &pEvdev->rmlvo.model);
+    if (!pEvdev->rmlvo.model)
+        SetXkbOption(pInfo, "XkbModel", &pEvdev->rmlvo.model);
+    SetXkbOption(pInfo, "xkb_layout", &pEvdev->rmlvo.layout);
+    if (!pEvdev->rmlvo.layout)
+        SetXkbOption(pInfo, "XkbLayout", &pEvdev->rmlvo.layout);
+    SetXkbOption(pInfo, "xkb_variant", &pEvdev->rmlvo.variant);
+    if (!pEvdev->rmlvo.variant)
+        SetXkbOption(pInfo, "XkbVariant", &pEvdev->rmlvo.variant);
+    SetXkbOption(pInfo, "xkb_options", &pEvdev->rmlvo.options);
+    if (!pEvdev->rmlvo.options)
+        SetXkbOption(pInfo, "XkbOptions", &pEvdev->rmlvo.options);
+
+    if (!InitKeyboardDeviceStruct(device, &pEvdev->rmlvo, NULL, EvdevKbdCtrl))
+        return !Success;
+
+    return Success;
+}
+
+#ifdef MULTITOUCH
+/* MT axes are counted twice - once as ABS_X (which the kernel keeps for
+ * backwards compatibility), once as ABS_MT_POSITION_X. So we need to keep a
+ * mapping of those axes to make sure we only count them once
+ */
+struct mt_axis_mappings {
+    int mt_code;
+    int code;
+    Bool needs_mapping; /* TRUE if both code and mt_code are present */
+    int mapping;        /* Logical mapping of 'code' axis */
+};
+
+static struct mt_axis_mappings mt_axis_mappings[] = {
+    {ABS_MT_POSITION_X, ABS_X},
+    {ABS_MT_POSITION_Y, ABS_Y},
+    {ABS_MT_PRESSURE, ABS_PRESSURE},
+    {ABS_MT_DISTANCE, ABS_DISTANCE},
+};
+#endif
+
+/**
+ * return TRUE if the axis is not one we should count as true axis
+ */
+static int
+is_blacklisted_axis(int axis)
+{
+    switch(axis)
+    {
+        case ABS_MT_SLOT:
+        case ABS_MT_TRACKING_ID:
+            return TRUE;
+        default:
+            return FALSE;
+    }
+}
+
+
+static int
+EvdevAddAbsValuatorClass(DeviceIntPtr device)
+{
+    InputInfoPtr pInfo;
+    EvdevPtr pEvdev;
+    int num_axes, axis, i = 0;
+    int num_mt_axes = 0, /* number of MT-only axes */
+        num_mt_axes_total = 0; /* total number of MT axes, including
+                                  double-counted ones, excluding blacklisted */
+    Atom *atoms;
+
+    pInfo = device->public.devicePrivate;
+    pEvdev = pInfo->private;
+
+    if (!EvdevBitIsSet(pEvdev->bitmask, EV_ABS))
+        goto out;
+
+    num_axes = EvdevCountBits(pEvdev->abs_bitmask, NLONGS(ABS_MAX));
+    if (num_axes < 1)
+        goto out;
+
+#ifdef MULTITOUCH
+    for (axis = ABS_MT_SLOT; axis < ABS_MAX; axis++)
+    {
+        if (EvdevBitIsSet(pEvdev->abs_bitmask, axis))
+        {
+            int j;
+            Bool skip = FALSE;
+
+            for (j = 0; j < ArrayLength(mt_axis_mappings); j++)
+            {
+                if (mt_axis_mappings[j].mt_code == axis &&
+                    BitIsOn(pEvdev->abs_bitmask, mt_axis_mappings[j].code))
+                {
+                    mt_axis_mappings[j].needs_mapping = TRUE;
+                    skip = TRUE;
+                }
+            }
+
+            if (!is_blacklisted_axis(axis))
+            {
+                num_mt_axes_total++;
+                if (!skip)
+                    num_mt_axes++;
+            }
+            num_axes--;
+        }
+    }
+#endif
+    if (num_axes + num_mt_axes > MAX_VALUATORS) {
+        xf86IDrvMsg(pInfo, X_WARNING, "found %d axes, limiting to %d.\n", num_axes, MAX_VALUATORS);
+        num_axes = MAX_VALUATORS;
+    }
+
+    if (num_axes < 1 && num_mt_axes_total < 1) {
+        xf86Msg(X_WARNING, "%s: no absolute or touch axes found.\n",
+                device->name);
+        return !Success;
+    }
+
+    pEvdev->num_vals = num_axes;
+    if (num_axes > 0) {
+        pEvdev->vals = valuator_mask_new(num_axes);
+        pEvdev->old_vals = valuator_mask_new(num_axes);
+        if (!pEvdev->vals || !pEvdev->old_vals) {
+            xf86IDrvMsg(pInfo, X_ERROR, "failed to allocate valuator masks.\n");
+            goto out;
+        }
+    }
+#ifdef MULTITOUCH
+    if (num_mt_axes_total > 0) {
+        pEvdev->mt_mask = valuator_mask_new(num_mt_axes_total);
+        if (!pEvdev->mt_mask) {
+            xf86Msg(X_ERROR, "%s: failed to allocate MT valuator mask.\n",
+                    device->name);
+            goto out;
+        }
+
+        pEvdev->last_mt_vals = calloc(num_slots(pEvdev), sizeof(ValuatorMask *));
+        if (!pEvdev->last_mt_vals) {
+            xf86IDrvMsg(pInfo, X_ERROR,
+                        "%s: failed to allocate MT last values mask array.\n",
+                        device->name);
+            goto out;
+        }
+
+        for (i = 0; i < num_slots(pEvdev); i++) {
+            pEvdev->last_mt_vals[i] = valuator_mask_new(num_mt_axes_total);
+            if (!pEvdev->last_mt_vals[i]) {
+                xf86IDrvMsg(pInfo, X_ERROR,
+                            "%s: failed to allocate MT last values mask.\n",
+                            device->name);
+                goto out;
+            }
+        }
+
+        for (i = 0; i < EVDEV_MAXQUEUE; i++) {
+            pEvdev->queue[i].touchMask =
+                valuator_mask_new(num_mt_axes_total);
+            if (!pEvdev->queue[i].touchMask) {
+                xf86Msg(X_ERROR, "%s: failed to allocate MT valuator masks for "
+                        "evdev event queue.\n", device->name);
+                goto out;
+            }
+        }
+    }
+#endif
+    atoms = malloc((pEvdev->num_vals + num_mt_axes) * sizeof(Atom));
+
+    i = 0;
+    for (axis = ABS_X; i < MAX_VALUATORS && axis <= ABS_MAX; axis++) {
+        int j;
+        int mapping;
+        pEvdev->axis_map[axis] = -1;
+        if (!EvdevBitIsSet(pEvdev->abs_bitmask, axis) ||
+            is_blacklisted_axis(axis))
+            continue;
+
+        mapping = i;
+
+#ifdef MULTITOUCH
+        for (j = 0; j < ArrayLength(mt_axis_mappings); j++)
+        {
+            if (mt_axis_mappings[j].code == axis)
+                mt_axis_mappings[j].mapping = mapping;
+            else if (mt_axis_mappings[j].mt_code == axis &&
+                    mt_axis_mappings[j].needs_mapping)
+                mapping = mt_axis_mappings[j].mapping;
+        }
+#endif
+        pEvdev->axis_map[axis] = mapping;
+        if (mapping == i)
+            i++;
+    }
+
+    EvdevInitAxesLabels(pEvdev, Absolute, pEvdev->num_vals + num_mt_axes, atoms);
+
+    if (!InitValuatorClassDeviceStruct(device, num_axes + num_mt_axes, atoms,
+                                       GetMotionHistorySize(), Absolute)) {
+        xf86IDrvMsg(pInfo, X_ERROR, "failed to initialize valuator class device.\n");
+        goto out;
+    }
+
+#ifdef MULTITOUCH
+    if (num_mt_axes_total > 0)
+    {
+        int num_touches = 0;
+        int mode = pEvdev->flags & EVDEV_TOUCHPAD ?
+            XIDependentTouch : XIDirectTouch;
+
+        if (pEvdev->mtdev->caps.slot.maximum > 0)
+            num_touches = pEvdev->mtdev->caps.slot.maximum;
+
+        if (!InitTouchClassDeviceStruct(device, num_touches, mode,
+                                        num_mt_axes_total)) {
+            xf86Msg(X_ERROR, "%s: failed to initialize touch class device.\n",
+                    device->name);
+            goto out;
+        }
+
+        for (i = 0; i < num_slots(pEvdev); i++) {
+            for (axis = ABS_MT_TOUCH_MAJOR; axis < ABS_MAX; axis++) {
+                if (pEvdev->axis_map[axis] >= 0) {
+                    /* XXX: read initial values from mtdev when it adds support
+                     *      for doing so. */
+                    valuator_mask_set(pEvdev->last_mt_vals[i],
+                                      pEvdev->axis_map[axis], 0);
+                }
+            }
+        }
+    }
+#endif
+
+    for (axis = ABS_X; axis < ABS_MT_SLOT; axis++) {
+        int axnum = pEvdev->axis_map[axis];
+        int resolution = 0;
+
+        if (axnum == -1)
+            continue;
+
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 30)
+        /* Kernel provides units/mm, X wants units/m */
+        if (pEvdev->absinfo[axis].resolution)
+            resolution = pEvdev->absinfo[axis].resolution * 1000;
+#endif
+
+        xf86InitValuatorAxisStruct(device, axnum,
+                                   atoms[axnum],
+                                   pEvdev->absinfo[axis].minimum,
+                                   pEvdev->absinfo[axis].maximum,
+                                   resolution, 0, resolution, Absolute);
+        xf86InitValuatorDefaults(device, axnum);
+    }
+
+#ifdef MULTITOUCH
+    for (axis = ABS_MT_TOUCH_MAJOR; axis <= ABS_MAX; axis++) {
+        int axnum = pEvdev->axis_map[axis];
+        int resolution = 0;
+        int j;
+        BOOL skip = FALSE;
+
+        if (axnum < 0)
+            continue;
+
+        for (j = 0; j < ArrayLength(mt_axis_mappings); j++)
+            if (mt_axis_mappings[j].mt_code == axis &&
+                    mt_axis_mappings[j].needs_mapping)
+            {
+                skip = TRUE;
+                break;
+            }
+
+        /* MT axis is mapped, don't set up twice */
+        if (skip)
+            continue;
+
+        if (pEvdev->absinfo[axis].resolution)
+            resolution = pEvdev->absinfo[axis].resolution * 1000;
+
+        xf86InitValuatorAxisStruct(device, axnum,
+                                   atoms[axnum],
+                                   pEvdev->absinfo[axis].minimum,
+                                   pEvdev->absinfo[axis].maximum,
+                                   resolution, 0, resolution,
+                                   Absolute);
+    }
+#endif
+
+    free(atoms);
+
+    for (i = 0; i < ArrayLength(proximity_bits); i++)
+    {
+        if (!pEvdev->use_proximity)
+            break;
+
+        if (EvdevBitIsSet(pEvdev->key_bitmask, proximity_bits[i]))
+        {
+            InitProximityClassDeviceStruct(device);
+            pEvdev->prox = valuator_mask_new(num_axes);
+            if (!pEvdev->prox) {
+                xf86IDrvMsg(pInfo, X_ERROR,
+                            "failed to allocate proximity valuator " "mask.\n");
+                goto out;
+            }
+            break;
+        }
+    }
+
+    if (!InitPtrFeedbackClassDeviceStruct(device, EvdevPtrCtrlProc)) {
+        xf86IDrvMsg(pInfo, X_ERROR,
+                    "failed to initialize pointer feedback class device.\n");
+        goto out;
+    }
+
+    if (pEvdev->flags & EVDEV_TOUCHPAD)
+        pEvdev->flags |= EVDEV_RELATIVE_MODE;
+    else
+        pEvdev->flags &= ~EVDEV_RELATIVE_MODE;
+
+    if (xf86FindOption(pInfo->options, "Mode"))
+    {
+        char *mode;
+        mode = xf86SetStrOption(pInfo->options, "Mode", NULL);
+        if (!strcasecmp("absolute", mode))
+            pEvdev->flags &= ~EVDEV_RELATIVE_MODE;
+        else if (!strcasecmp("relative", mode))
+            pEvdev->flags |= EVDEV_RELATIVE_MODE;
+        else
+            xf86IDrvMsg(pInfo, X_INFO, "unknown mode, use default\n");
+        free(mode);
+    }
+
+    return Success;
+
+out:
+    EvdevFreeMasks(pEvdev);
+    return !Success;
+}
+
+static int
+EvdevAddRelValuatorClass(DeviceIntPtr device)
+{
+    InputInfoPtr pInfo;
+    EvdevPtr pEvdev;
+    int num_axes, axis, i = 0;
+    Atom *atoms;
+
+    pInfo = device->public.devicePrivate;
+    pEvdev = pInfo->private;
+
+    if (!EvdevBitIsSet(pEvdev->bitmask, EV_REL))
+        goto out;
+
+    num_axes = EvdevCountBits(pEvdev->rel_bitmask, NLONGS(REL_MAX));
+    if (num_axes < 1)
+        goto out;
+
+#ifndef HAVE_SMOOTH_SCROLLING
+    /* Wheels are special, we post them as button events. So let's ignore them
+     * in the axes list too */
+    if (EvdevBitIsSet(pEvdev->rel_bitmask, REL_WHEEL))
+        num_axes--;
+    if (EvdevBitIsSet(pEvdev->rel_bitmask, REL_HWHEEL))
+        num_axes--;
+    if (EvdevBitIsSet(pEvdev->rel_bitmask, REL_DIAL))
+        num_axes--;
+
+    if (num_axes <= 0)
+        goto out;
+#endif
+
+    if (num_axes > MAX_VALUATORS) {
+        xf86IDrvMsg(pInfo, X_WARNING, "found %d axes, limiting to %d.\n", num_axes, MAX_VALUATORS);
+        num_axes = MAX_VALUATORS;
+    }
+
+    pEvdev->num_vals = num_axes;
+    if (num_axes > 0) {
+        pEvdev->vals = valuator_mask_new(num_axes);
+        if (!pEvdev->vals)
+            goto out;
+    }
+    atoms = malloc(pEvdev->num_vals * sizeof(Atom));
+
+    for (axis = REL_X; i < MAX_VALUATORS && axis <= REL_MAX; axis++)
+    {
+        pEvdev->axis_map[axis] = -1;
+#ifndef HAVE_SMOOTH_SCROLLING
+        /* We don't post wheel events, so ignore them here too */
+        if (axis == REL_WHEEL || axis == REL_HWHEEL || axis == REL_DIAL)
+            continue;
+#endif
+        if (!EvdevBitIsSet(pEvdev->rel_bitmask, axis))
+            continue;
+        pEvdev->axis_map[axis] = i;
+        i++;
+    }
+
+    EvdevInitAxesLabels(pEvdev, Relative, pEvdev->num_vals, atoms);
+
+    if (!InitValuatorClassDeviceStruct(device, num_axes, atoms,
+                                       GetMotionHistorySize(), Relative)) {
+        xf86IDrvMsg(pInfo, X_ERROR, "failed to initialize valuator class device.\n");
+        goto out;
+    }
+
+    if (!InitPtrFeedbackClassDeviceStruct(device, EvdevPtrCtrlProc)) {
+        xf86IDrvMsg(pInfo, X_ERROR, "failed to initialize pointer feedback class "
+                "device.\n");
+        goto out;
+    }
+
+    for (axis = REL_X; axis <= REL_MAX; axis++)
+    {
+        int axnum = pEvdev->axis_map[axis];
+
+        if (axnum == -1)
+            continue;
+        xf86InitValuatorAxisStruct(device, axnum, atoms[axnum], -1, -1, 1, 0, 1,
+                                   Relative);
+        xf86InitValuatorDefaults(device, axnum);
+#ifdef HAVE_SMOOTH_SCROLLING
+        if (axis == REL_WHEEL)
+            SetScrollValuator(device, axnum, SCROLL_TYPE_VERTICAL, -1.0, SCROLL_FLAG_PREFERRED);
+        else if (axis == REL_DIAL)
+            SetScrollValuator(device, axnum, SCROLL_TYPE_VERTICAL, -1.0, SCROLL_FLAG_NONE);
+        else if (axis == REL_HWHEEL)
+            SetScrollValuator(device, axnum, SCROLL_TYPE_HORIZONTAL, -1.0, SCROLL_FLAG_NONE);
+#endif
+    }
+
+    free(atoms);
+
+    return Success;
+
+out:
+    valuator_mask_free(&pEvdev->vals);
+    return !Success;
+}
+
+static int
+EvdevAddButtonClass(DeviceIntPtr device)
+{
+    InputInfoPtr pInfo;
+    EvdevPtr pEvdev;
+    Atom *labels;
+
+    pInfo = device->public.devicePrivate;
+    pEvdev = pInfo->private;
+
+    labels = malloc(pEvdev->num_buttons * sizeof(Atom));
+    EvdevInitButtonLabels(pEvdev, pEvdev->num_buttons, labels);
+
+    if (!InitButtonClassDeviceStruct(device, pEvdev->num_buttons, labels,
+                                     pEvdev->btnmap))
+    {
+        free(labels);
+        return !Success;
+    }
+
+    free(labels);
+    return Success;
+}
+
+/**
+ * Init the button mapping for the device. By default, this is a 1:1 mapping,
+ * i.e. Button 1 maps to Button 1, Button 2 to 2, etc.
+ *
+ * If a mapping has been specified, the mapping is the default, with the
+ * user-defined ones overwriting the defaults.
+ * i.e. a user-defined mapping of "3 2 1" results in a mapping of 3 2 1 4 5 6 ...
+ *
+ * Invalid button mappings revert to the default.
+ *
+ * Note that index 0 is unused, button 0 does not exist.
+ * This mapping is initialised for all devices, but only applied if the device
+ * has buttons (in EvdevAddButtonClass).
+ */
+static void
+EvdevInitButtonMapping(InputInfoPtr pInfo)
+{
+    int         i, nbuttons     = 1;
+    char       *mapping         = NULL;
+    EvdevPtr    pEvdev          = pInfo->private;
+
+    /* Check for user-defined button mapping */
+    if ((mapping = xf86CheckStrOption(pInfo->options, "ButtonMapping", NULL)))
+    {
+        char    *map, *s = " ";
+        int     btn = 0;
+
+        xf86IDrvMsg(pInfo, X_CONFIG, "ButtonMapping '%s'\n", mapping);
+        map = mapping;
+        while (s && *s != '\0' && nbuttons < EVDEV_MAXBUTTONS)
+        {
+            btn = strtol(map, &s, 10);
+
+            if (s == map || btn < 0 || btn > EVDEV_MAXBUTTONS)
+            {
+                xf86IDrvMsg(pInfo, X_ERROR,
+                            "... Invalid button mapping. Using defaults\n");
+                nbuttons = 1; /* ensure defaults start at 1 */
+                break;
+            }
+
+            pEvdev->btnmap[nbuttons++] = btn;
+            map = s;
+        }
+        free(mapping);
+    }
+
+    for (i = nbuttons; i < ArrayLength(pEvdev->btnmap); i++)
+        pEvdev->btnmap[i] = i;
+
+}
+
+static void
+EvdevInitAnyValuators(DeviceIntPtr device, EvdevPtr pEvdev)
+{
+    InputInfoPtr pInfo = device->public.devicePrivate;
+
+    if (pEvdev->flags & EVDEV_RELATIVE_EVENTS &&
+        EvdevAddRelValuatorClass(device) == Success)
+        xf86IDrvMsg(pInfo, X_INFO, "initialized for relative axes.\n");
+    if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS &&
+        EvdevAddAbsValuatorClass(device) == Success)
+        xf86IDrvMsg(pInfo, X_INFO, "initialized for absolute axes.\n");
+}
+
+static void
+EvdevInitAbsValuators(DeviceIntPtr device, EvdevPtr pEvdev)
+{
+    InputInfoPtr pInfo = device->public.devicePrivate;
+
+    if (EvdevAddAbsValuatorClass(device) == Success) {
+        xf86IDrvMsg(pInfo, X_INFO,"initialized for absolute axes.\n");
+    } else {
+        xf86IDrvMsg(pInfo, X_ERROR,"failed to initialize for absolute axes.\n");
+        pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS;
+    }
+}
+
+static void
+EvdevInitRelValuators(DeviceIntPtr device, EvdevPtr pEvdev)
+{
+    InputInfoPtr pInfo = device->public.devicePrivate;
+    int has_abs_axes = pEvdev->flags & EVDEV_ABSOLUTE_EVENTS;
+
+    if (EvdevAddRelValuatorClass(device) == Success) {
+
+        xf86IDrvMsg(pInfo, X_INFO,"initialized for relative axes.\n");
+
+        if (has_abs_axes) {
+            xf86IDrvMsg(pInfo, X_WARNING,"ignoring absolute axes.\n");
+            pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS;
+        }
+
+    } else {
+        xf86IDrvMsg(pInfo, X_ERROR,"failed to initialize for relative axes.\n");
+
+        pEvdev->flags &= ~EVDEV_RELATIVE_EVENTS;
+
+        if (has_abs_axes)
+            EvdevInitAbsValuators(device, pEvdev);
+    }
+}
+
+static void
+EvdevInitTouchDevice(DeviceIntPtr device, EvdevPtr pEvdev)
+{
+    InputInfoPtr pInfo = device->public.devicePrivate;
+
+    if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) {
+        xf86IDrvMsg(pInfo, X_WARNING, "touchpads, tablets and touchscreens "
+                    "ignore relative axes.\n");
+        pEvdev->flags &= ~EVDEV_RELATIVE_EVENTS;
+    }
+
+    EvdevInitAbsValuators(device, pEvdev);
+}
+
+static int
+EvdevInit(DeviceIntPtr device)
+{
+    int i;
+    InputInfoPtr pInfo;
+    EvdevPtr pEvdev;
+
+    pInfo = device->public.devicePrivate;
+    pEvdev = pInfo->private;
+
+    /* clear all axis_map entries */
+    for(i = 0; i < max(ABS_CNT,REL_CNT); i++)
+      pEvdev->axis_map[i]=-1;
+
+    if (pEvdev->flags & EVDEV_KEYBOARD_EVENTS)
+       EvdevAddKeyClass(device);
+    if (pEvdev->flags & EVDEV_BUTTON_EVENTS)
+       EvdevAddButtonClass(device);
+
+    /* We don't allow relative and absolute axes on the same device. The
+     * reason is that some devices (MS Optical Desktop 2000) register both
+     * rel and abs axes for x/y.
+     *
+     * The abs axes register min/max; this min/max then also applies to the
+     * relative device (the mouse) and caps it at 0..255 for both axes.
+     * So, unless you have a small screen, you won't be enjoying it much;
+     * consequently, absolute axes are generally ignored.
+     *
+     * However, currenly only a device with absolute axes can be registered
+     * as a touch{pad,screen}. Thus, given such a device, absolute axes are
+     * used and relative axes are ignored.
+     */
+
+    if (pEvdev->flags & (EVDEV_UNIGNORE_RELATIVE | EVDEV_UNIGNORE_ABSOLUTE))
+        EvdevInitAnyValuators(device, pEvdev);
+    else if (pEvdev->flags & (EVDEV_TOUCHPAD | EVDEV_TOUCHSCREEN | EVDEV_TABLET))
+        EvdevInitTouchDevice(device, pEvdev);
+    else if (pEvdev->flags & EVDEV_RELATIVE_EVENTS)
+        EvdevInitRelValuators(device, pEvdev);
+
+#ifdef _F_INIT_ABS_ONLY_FOR_POINTER_
+    else if ( !(pEvdev->flags & EVDEV_KEYBOARD_EVENTS) && (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) )
+#else /* #ifdef _F_INIT_ABS_ONLY_FOR_POINTER_ */
+    else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS)
+#endif /* #ifdef _F_INIT_ABS_ONLY_FOR_POINTER_ */
+        EvdevInitAbsValuators(device, pEvdev);
+
+    /* We drop the return value, the only time we ever want the handlers to
+     * unregister is when the device dies. In which case we don't have to
+     * unregister anyway */
+    EvdevInitProperty(device);
+    XIRegisterPropertyHandler(device, EvdevSetProperty, NULL, NULL);
+    EvdevMBEmuInitProperty(device);
+    Evdev3BEmuInitProperty(device);
+    EvdevWheelEmuInitProperty(device);
+    EvdevDragLockInitProperty(device);
+    EvdevAppleInitProperty(device);
+
+    return Success;
+}
+
+/**
+ * Init all extras (wheel emulation, etc.) and grab the device.
+ */
+static int
+EvdevOn(DeviceIntPtr device)
+{
+    InputInfoPtr pInfo;
+    EvdevPtr pEvdev;
+    int rc = Success;
+
+    pInfo = device->public.devicePrivate;
+    pEvdev = pInfo->private;
+    /* after PreInit fd is still open */
+    rc = EvdevOpenDevice(pInfo);
+    if (rc != Success)
+        return rc;
+
+    EvdevGrabDevice(pInfo, 1, 0);
+
+    xf86FlushInput(pInfo->fd);
+    xf86AddEnabledDevice(pInfo);
+    EvdevMBEmuOn(pInfo);
+    Evdev3BEmuOn(pInfo);
+    pEvdev->flags |= EVDEV_INITIALIZED;
+    device->public.on = TRUE;
+
+    return Success;
+}
+
+
+static int
+EvdevProc(DeviceIntPtr device, int what)
+{
+    InputInfoPtr pInfo;
+    EvdevPtr pEvdev;
+#ifdef _F_EVDEV_CONFINE_REGION_
+    int region[6] = { 0, };
+#endif /* #ifdef _F_EVDEV_CONFINE_REGION_ */
+
+    pInfo = device->public.devicePrivate;
+    pEvdev = pInfo->private;
+
+    switch (what)
+    {
+    case DEVICE_INIT:
+       return EvdevInit(device);
+
+    case DEVICE_ON:
+        return EvdevOn(device);
+
+    case DEVICE_OFF:
+        if (pEvdev->flags & EVDEV_INITIALIZED)
+        {
+            EvdevMBEmuFinalize(pInfo);
+            Evdev3BEmuFinalize(pInfo);
+        }
+        if (pInfo->fd != -1)
+        {
+            EvdevGrabDevice(pInfo, 0, 1);
+            xf86RemoveEnabledDevice(pInfo);
+            close(pInfo->fd);
+            pInfo->fd = -1;
+        }
+
+#ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_
+        if (pEvdev->rel_move_timer)
+        {
+            TimerCancel(pEvdev->rel_move_timer);
+            pEvdev->rel_move_timer = NULL;
+            pEvdev->rel_move_status = 0;
+            pEvdev->rel_move_ack = 0;
+            ErrorF("[%s][dev:%d] DEVICE_OFF (rel_move_status=%d, rel_move_prop_set=%d)\n", __FUNCTION__, pInfo->dev->id, pEvdev->rel_move_status,
+                    pEvdev->rel_move_prop_set);
+        }
+#endif /* #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_ */
+
+        pEvdev->min_maj = 0;
+        pEvdev->flags &= ~EVDEV_INITIALIZED;
+       device->public.on = FALSE;
+       break;
+
+    case DEVICE_CLOSE:
+#ifdef _F_EVDEV_CONFINE_REGION_
+       if(pEvdev->pointer_confine_region && pEvdev->confined_id)
+               EvdevSetConfineRegion(pInfo, 1, &region[0]);
+#endif /* _F_EVDEV_CONFINE_REGION_ */
+       xf86IDrvMsg(pInfo, X_INFO, "Close\n");
+        if (pInfo->fd != -1) {
+            close(pInfo->fd);
+            pInfo->fd = -1;
+        }
+        EvdevFreeMasks(pEvdev);
+        EvdevRemoveDevice(pInfo);
+        pEvdev->min_maj = 0;
+       break;
+
+    default:
+        return BadValue;
+    }
+
+    return Success;
+}
+
+/**
+ * Get as much information as we can from the fd and cache it.
+ *
+ * @return Success if the information was cached, or !Success otherwise.
+ */
+static int
+EvdevCache(InputInfoPtr pInfo)
+{
+    EvdevPtr pEvdev = pInfo->private;
+    int i, len;
+    struct input_id id;
+
+    char name[1024]                  = {0};
+    unsigned long bitmask[NLONGS(EV_CNT)]      = {0};
+    unsigned long key_bitmask[NLONGS(KEY_CNT)] = {0};
+    unsigned long rel_bitmask[NLONGS(REL_CNT)] = {0};
+    unsigned long abs_bitmask[NLONGS(ABS_CNT)] = {0};
+    unsigned long led_bitmask[NLONGS(LED_CNT)] = {0};
+
+
+    if (ioctl(pInfo->fd, EVIOCGID, &id) < 0)
+    {
+        xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGID failed: %s\n", strerror(errno));
+        goto error;
+    }
+
+    pEvdev->id_vendor = id.vendor;
+    pEvdev->id_product = id.product;
+
+    if (ioctl(pInfo->fd, EVIOCGNAME(sizeof(name) - 1), name) < 0) {
+        xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGNAME failed: %s\n", strerror(errno));
+        goto error;
+    }
+
+    strcpy(pEvdev->name, name);
+
+    len = ioctl(pInfo->fd, EVIOCGBIT(0, sizeof(bitmask)), bitmask);
+    if (len < 0) {
+        xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGBIT failed: %s\n",
+                    strerror(errno));
+        goto error;
+    }
+
+    memcpy(pEvdev->bitmask, bitmask, len);
+
+    len = ioctl(pInfo->fd, EVIOCGBIT(EV_REL, sizeof(rel_bitmask)), rel_bitmask);
+    if (len < 0) {
+        xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGBIT failed: %s\n",
+                    strerror(errno));
+        goto error;
+    }
+
+    memcpy(pEvdev->rel_bitmask, rel_bitmask, len);
+
+    len = ioctl(pInfo->fd, EVIOCGBIT(EV_ABS, sizeof(abs_bitmask)), abs_bitmask);
+    if (len < 0) {
+        xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGBIT failed: %s\n",
+                    strerror(errno));
+        goto error;
+    }
+
+    memcpy(pEvdev->abs_bitmask, abs_bitmask, len);
+
+    len = ioctl(pInfo->fd, EVIOCGBIT(EV_LED, sizeof(led_bitmask)), led_bitmask);
+    if (len < 0) {
+        xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGBIT failed: %s\n",
+                    strerror(errno));
+        goto error;
+    }
+
+    memcpy(pEvdev->led_bitmask, led_bitmask, len);
+
+    /*
+     * Do not try to validate absinfo data since it is not expected
+     * to be static, always refresh it in evdev structure.
+     */
+    for (i = ABS_X; i <= ABS_MAX; i++) {
+        if (EvdevBitIsSet(abs_bitmask, i)) {
+            len = ioctl(pInfo->fd, EVIOCGABS(i), &pEvdev->absinfo[i]);
+            if (len < 0) {
+                xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGABSi(%d) failed: %s\n",
+                            i, strerror(errno));
+                goto error;
+            }
+            xf86IDrvMsgVerb(pInfo, X_PROBED, 6, "absolute axis %#x [%d..%d]\n",
+                            i, pEvdev->absinfo[i].maximum, pEvdev->absinfo[i].minimum);
+        }
+    }
+
+    len = ioctl(pInfo->fd, EVIOCGBIT(EV_KEY, sizeof(key_bitmask)), key_bitmask);
+    if (len < 0) {
+        xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGBIT failed: %s\n",
+                    strerror(errno));
+        goto error;
+    }
+
+    /* Copy the data so we have reasonably up-to-date info */
+    memcpy(pEvdev->key_bitmask, key_bitmask, len);
+
+    return Success;
+
+error:
+    return !Success;
+
+}
+
+/**
+ * Issue an EVIOCGRAB on the device file, either as a grab or to ungrab, or
+ * both. Return TRUE on success, otherwise FALSE. Failing the release is a
+ * still considered a success, because it's not as if you could do anything
+ * about it.
+ */
+static BOOL
+EvdevGrabDevice(InputInfoPtr pInfo, int grab, int ungrab)
+{
+    EvdevPtr pEvdev = pInfo->private;
+
+    if (pEvdev->grabDevice)
+    {
+        if (grab && ioctl(pInfo->fd, EVIOCGRAB, (void *)1)) {
+            xf86IDrvMsg(pInfo, X_WARNING, "Grab failed (%s)\n",
+                        strerror(errno));
+            return FALSE;
+        } else if (ungrab && ioctl(pInfo->fd, EVIOCGRAB, (void *)0))
+            xf86IDrvMsg(pInfo, X_WARNING, "Release failed (%s)\n",
+                        strerror(errno));
+    }
+
+    return TRUE;
+}
+
+/**
+ * Some devices only have other axes (e.g. wheels), but we
+ * still need x/y for these. The server relies on devices having
+ * x/y as axes 0/1 and core/XI 1.x clients expect it too (#44655)
+ */
+static void
+EvdevForceXY(InputInfoPtr pInfo, int mode)
+{
+    EvdevPtr pEvdev = pInfo->private;
+
+    xf86IDrvMsg(pInfo, X_INFO, "Forcing %s x/y axes to exist.\n",
+                (mode == Relative) ? "relative" : "absolute");
+
+    if (mode == Relative)
+    {
+        EvdevSetBit(pEvdev->rel_bitmask, REL_X);
+        EvdevSetBit(pEvdev->rel_bitmask, REL_Y);
+    } else if (mode == Absolute)
+    {
+        EvdevSetBit(pEvdev->abs_bitmask, ABS_X);
+        EvdevSetBit(pEvdev->abs_bitmask, ABS_Y);
+        pEvdev->absinfo[ABS_X].minimum = 0;
+        pEvdev->absinfo[ABS_X].maximum = 1000;
+        pEvdev->absinfo[ABS_X].value = 0;
+        pEvdev->absinfo[ABS_X].resolution = 0;
+        pEvdev->absinfo[ABS_Y].minimum = 0;
+        pEvdev->absinfo[ABS_Y].maximum = 1000;
+        pEvdev->absinfo[ABS_Y].value = 0;
+        pEvdev->absinfo[ABS_Y].resolution = 0;
+    }
+}
+
+static int
+EvdevProbe(InputInfoPtr pInfo)
+{
+    int i, has_rel_axes, has_abs_axes, has_keys, num_buttons, has_scroll;
+    int has_lmr; /* left middle right */
+    int has_mt; /* multitouch */
+    int ignore_abs = 0, ignore_rel = 0;
+    EvdevPtr pEvdev = pInfo->private;
+    int rc = 1;
+
+    xf86IDrvMsg(pInfo, X_PROBED, "Vendor %#hx Product %#hx\n",
+                pEvdev->id_vendor, pEvdev->id_product);
+
+    /* Trinary state for ignoring axes:
+       - unset: do the normal thing.
+       - TRUE: explicitly ignore them.
+       - FALSE: unignore axes, use them at all cost if they're present.
+     */
+    if (xf86FindOption(pInfo->options, "IgnoreRelativeAxes"))
+    {
+        if (xf86SetBoolOption(pInfo->options, "IgnoreRelativeAxes", FALSE))
+            ignore_rel = TRUE;
+        else
+            pEvdev->flags |= EVDEV_UNIGNORE_RELATIVE;
+
+    }
+    if (xf86FindOption(pInfo->options, "IgnoreAbsoluteAxes"))
+    {
+        if (xf86SetBoolOption(pInfo->options, "IgnoreAbsoluteAxes", FALSE))
+           ignore_abs = TRUE;
+        else
+            pEvdev->flags |= EVDEV_UNIGNORE_ABSOLUTE;
+    }
+
+    has_rel_axes = FALSE;
+    has_abs_axes = FALSE;
+    has_keys = FALSE;
+    has_scroll = FALSE;
+    has_lmr = FALSE;
+    has_mt = FALSE;
+    num_buttons = 0;
+
+    /* count all buttons */
+    for (i = BTN_MISC; i < BTN_JOYSTICK; i++)
+    {
+        int mapping = 0;
+        if (EvdevBitIsSet(pEvdev->key_bitmask, i))
+        {
+            mapping = EvdevUtilButtonEventToButtonNumber(pEvdev, i);
+            if (mapping > num_buttons)
+                num_buttons = mapping;
+        }
+    }
+
+    has_lmr = EvdevBitIsSet(pEvdev->key_bitmask, BTN_LEFT) ||
+                EvdevBitIsSet(pEvdev->key_bitmask, BTN_MIDDLE) ||
+                EvdevBitIsSet(pEvdev->key_bitmask, BTN_RIGHT);
+
+    if (num_buttons)
+    {
+        pEvdev->flags |= EVDEV_BUTTON_EVENTS;
+        pEvdev->num_buttons = num_buttons;
+        xf86IDrvMsg(pInfo, X_PROBED, "Found %d mouse buttons\n", num_buttons);
+    }
+
+    for (i = 0; i < REL_MAX; i++) {
+        if (EvdevBitIsSet(pEvdev->rel_bitmask, i)) {
+            has_rel_axes = TRUE;
+            break;
+        }
+    }
+
+    if (has_rel_axes) {
+        if (EvdevBitIsSet(pEvdev->rel_bitmask, REL_WHEEL) ||
+            EvdevBitIsSet(pEvdev->rel_bitmask, REL_HWHEEL) ||
+            EvdevBitIsSet(pEvdev->rel_bitmask, REL_DIAL)) {
+            xf86IDrvMsg(pInfo, X_PROBED, "Found scroll wheel(s)\n");
+            has_scroll = TRUE;
+            if (!num_buttons)
+                xf86IDrvMsg(pInfo, X_INFO,
+                            "Forcing buttons for scroll wheel(s)\n");
+            num_buttons = (num_buttons < 3) ? 7 : num_buttons + 4;
+            pEvdev->num_buttons = num_buttons;
+        }
+
+        if (!ignore_rel)
+        {
+            xf86IDrvMsg(pInfo, X_PROBED, "Found relative axes\n");
+            pEvdev->flags |= EVDEV_RELATIVE_EVENTS;
+
+            if (EvdevBitIsSet(pEvdev->rel_bitmask, REL_X) &&
+                EvdevBitIsSet(pEvdev->rel_bitmask, REL_Y)) {
+                xf86IDrvMsg(pInfo, X_PROBED, "Found x and y relative axes\n");
+            } else if (!EvdevBitIsSet(pEvdev->abs_bitmask, ABS_X) ||
+                       !EvdevBitIsSet(pEvdev->abs_bitmask, ABS_Y))
+                EvdevForceXY(pInfo, Relative);
+        } else {
+            xf86IDrvMsg(pInfo, X_INFO, "Relative axes present but ignored.\n");
+            has_rel_axes = FALSE;
+        }
+    }
+
+    for (i = 0; i < ABS_MAX; i++) {
+        if (EvdevBitIsSet(pEvdev->abs_bitmask, i)) {
+            has_abs_axes = TRUE;
+            break;
+        }
+    }
+
+#ifdef MULTITOUCH
+    for (i = ABS_MT_SLOT; i < ABS_MAX; i++) {
+        if (EvdevBitIsSet(pEvdev->abs_bitmask, i)) {
+            has_mt = TRUE;
+            break;
+        }
+    }
+#endif
+
+    if (ignore_abs && has_abs_axes)
+    {
+        xf86IDrvMsg(pInfo, X_INFO, "Absolute axes present but ignored.\n");
+        has_abs_axes = FALSE;
+    } else if (has_abs_axes) {
+        xf86IDrvMsg(pInfo, X_PROBED, "Found absolute axes\n");
+        pEvdev->flags |= EVDEV_ABSOLUTE_EVENTS;
+
+        if (has_mt)
+            xf86IDrvMsg(pInfo, X_PROBED, "Found absolute multitouch axes\n");
+
+        if ((EvdevBitIsSet(pEvdev->abs_bitmask, ABS_X) &&
+             EvdevBitIsSet(pEvdev->abs_bitmask, ABS_Y))) {
+            xf86IDrvMsg(pInfo, X_PROBED, "Found x and y absolute axes\n");
+            if (EvdevBitIsSet(pEvdev->key_bitmask, BTN_TOOL_PEN) ||
+                EvdevBitIsSet(pEvdev->key_bitmask, BTN_STYLUS) ||
+                EvdevBitIsSet(pEvdev->key_bitmask, BTN_STYLUS2))
+            {
+                xf86IDrvMsg(pInfo, X_PROBED, "Found absolute tablet.\n");
+                pEvdev->flags |= EVDEV_TABLET;
+                if (!pEvdev->num_buttons)
+                {
+                    pEvdev->num_buttons = 7; /* LMR + scroll wheels */
+                    pEvdev->flags |= EVDEV_BUTTON_EVENTS;
+                }
+            } else if (EvdevBitIsSet(pEvdev->abs_bitmask, ABS_PRESSURE) ||
+                EvdevBitIsSet(pEvdev->key_bitmask, BTN_TOUCH)) {
+                if (has_lmr || EvdevBitIsSet(pEvdev->key_bitmask, BTN_TOOL_FINGER)) {
+                    xf86IDrvMsg(pInfo, X_PROBED, "Found absolute touchpad.\n");
+                    pEvdev->flags |= EVDEV_TOUCHPAD;
+                } else {
+                    xf86IDrvMsg(pInfo, X_PROBED, "Found absolute touchscreen\n");
+                    pEvdev->flags |= EVDEV_TOUCHSCREEN;
+                    pEvdev->flags |= EVDEV_BUTTON_EVENTS;
+                }
+            } else if (!(EvdevBitIsSet(pEvdev->rel_bitmask, REL_X) &&
+                         EvdevBitIsSet(pEvdev->rel_bitmask, REL_Y)) && has_lmr) {
+                    /* some touchscreens use BTN_LEFT rather than BTN_TOUCH */
+                    xf86IDrvMsg(pInfo, X_PROBED, "Found absolute touchscreen\n");
+                    pEvdev->flags |= EVDEV_TOUCHSCREEN;
+                    pEvdev->flags |= EVDEV_BUTTON_EVENTS;
+            }
+        } else {
+#ifdef MULTITOUCH
+            if (!EvdevBitIsSet(pEvdev->abs_bitmask, ABS_MT_POSITION_X) ||
+                !EvdevBitIsSet(pEvdev->abs_bitmask, ABS_MT_POSITION_Y))
+#endif
+                EvdevForceXY(pInfo, Absolute);
+        }
+    }
+
+    for (i = 0; i < BTN_MISC; i++) {
+        if (EvdevBitIsSet(pEvdev->key_bitmask, i)) {
+            xf86IDrvMsg(pInfo, X_PROBED, "Found keys\n");
+            pEvdev->flags |= EVDEV_KEYBOARD_EVENTS;
+            has_keys = TRUE;
+            break;
+        }
+    }
+
+    if (has_rel_axes || has_abs_axes)
+    {
+        char *str;
+        int num_calibration = 0, calibration[4] = { 0, 0, 0, 0 };
+
+        pEvdev->invert_x = xf86SetBoolOption(pInfo->options, "InvertX", FALSE);
+        pEvdev->invert_y = xf86SetBoolOption(pInfo->options, "InvertY", FALSE);
+        pEvdev->swap_axes = xf86SetBoolOption(pInfo->options, "SwapAxes", FALSE);
+
+        str = xf86CheckStrOption(pInfo->options, "Calibration", NULL);
+        if (str) {
+            num_calibration = sscanf(str, "%d %d %d %d",
+                    &calibration[0], &calibration[1],
+                    &calibration[2], &calibration[3]);
+            free(str);
+            if (num_calibration == 4)
+                EvdevSetCalibration(pInfo, num_calibration, calibration);
+            else
+                xf86IDrvMsg(pInfo, X_ERROR,
+                            "Insufficient calibration factors (%d). Ignoring calibration\n",
+                            num_calibration);
+        }
+    }
+
+    if (has_rel_axes || has_abs_axes || num_buttons) {
+        pInfo->flags |= XI86_SEND_DRAG_EVENTS;
+       if (pEvdev->flags & EVDEV_TOUCHPAD) {
+           xf86IDrvMsg(pInfo, X_INFO, "Configuring as touchpad\n");
+           pInfo->type_name = XI_TOUCHPAD;
+           pEvdev->use_proximity = 0;
+       } else if (pEvdev->flags & EVDEV_TABLET) {
+           xf86IDrvMsg(pInfo, X_INFO, "Configuring as tablet\n");
+           pInfo->type_name = XI_TABLET;
+        } else if (pEvdev->flags & EVDEV_TOUCHSCREEN) {
+            xf86IDrvMsg(pInfo, X_INFO, "Configuring as touchscreen\n");
+            pInfo->type_name = XI_TOUCHSCREEN;
+       } else {
+           xf86IDrvMsg(pInfo, X_INFO, "Configuring as mouse\n");
+           pInfo->type_name = XI_MOUSE;
+       }
+
+        rc = 0;
+    }
+
+    if (has_keys) {
+        xf86IDrvMsg(pInfo, X_INFO, "Configuring as keyboard\n");
+        pInfo->type_name = XI_KEYBOARD;
+        rc = 0;
+    }
+
+    if (has_scroll &&
+        (has_rel_axes || has_abs_axes || num_buttons || has_keys))
+    {
+        xf86IDrvMsg(pInfo, X_INFO, "Adding scrollwheel support\n");
+        pEvdev->flags |= EVDEV_BUTTON_EVENTS;
+        pEvdev->flags |= EVDEV_RELATIVE_EVENTS;
+    }
+
+    if (rc)
+        xf86IDrvMsg(pInfo, X_WARNING, "Don't know how to use device\n");
+
+    return rc;
+}
+
+static void
+EvdevSetCalibration(InputInfoPtr pInfo, int num_calibration, int calibration[4])
+{
+    EvdevPtr pEvdev = pInfo->private;
+
+    if (num_calibration == 0) {
+        pEvdev->flags &= ~EVDEV_CALIBRATED;
+        pEvdev->calibration.min_x = 0;
+        pEvdev->calibration.max_x = 0;
+        pEvdev->calibration.min_y = 0;
+        pEvdev->calibration.max_y = 0;
+    } else if (num_calibration == 4) {
+        pEvdev->flags |= EVDEV_CALIBRATED;
+        pEvdev->calibration.min_x = calibration[0];
+        pEvdev->calibration.max_x = calibration[1];
+        pEvdev->calibration.min_y = calibration[2];
+        pEvdev->calibration.max_y = calibration[3];
+    }
+}
+
+static int
+EvdevOpenDevice(InputInfoPtr pInfo)
+{
+    EvdevPtr pEvdev = pInfo->private;
+    char *device = pEvdev->device;
+
+    if (!device)
+    {
+        device = xf86CheckStrOption(pInfo->options, "Device", NULL);
+        if (!device) {
+            xf86IDrvMsg(pInfo, X_ERROR, "No device specified.\n");
+            return BadValue;
+        }
+
+        pEvdev->device = device;
+        xf86IDrvMsg(pInfo, X_CONFIG, "Device: \"%s\"\n", device);
+    }
+
+    if (pInfo->fd < 0)
+    {
+        do {
+            pInfo->fd = open(device, O_RDWR | O_NONBLOCK, 0);
+        } while (pInfo->fd < 0 && errno == EINTR);
+
+        if (pInfo->fd < 0) {
+            xf86IDrvMsg(pInfo, X_ERROR, "Unable to open evdev device \"%s\".\n", device);
+            return BadValue;
+        }
+    }
+
+
+    /* Check major/minor of device node to avoid adding duplicate devices. */
+    pEvdev->min_maj = EvdevGetMajorMinor(pInfo);
+    if (EvdevIsDuplicate(pInfo))
+    {
+        xf86IDrvMsg(pInfo, X_WARNING, "device file is duplicate. Ignoring.\n");
+        close(pInfo->fd);
+#ifdef MULTITOUCH
+        mtdev_close_delete(pEvdev->mtdev);
+        pEvdev->mtdev = NULL;
+#endif
+        return BadMatch;
+    }
+
+    return Success;
+}
+
+#ifdef _F_EVDEV_CONFINE_REGION_
+DeviceIntPtr
+GetMasterPointerFromId(int deviceid)
+{
+       DeviceIntPtr pDev = inputInfo.devices;
+       while(pDev)
+       {
+               if( pDev->id == deviceid && pDev->master )
+               {
+                       return pDev->master;
+               }
+               pDev = pDev->next;
+       }
+
+       return NULL;
+}
+
+Bool
+IsMaster(DeviceIntPtr dev)
+{
+    return dev->type == MASTER_POINTER || dev->type == MASTER_KEYBOARD;
+}
+
+DeviceIntPtr
+GetPairedDevice(DeviceIntPtr dev)
+{
+    if (!IsMaster(dev) && dev->master)
+        dev = dev->master;
+
+    return dev->spriteInfo->paired;
+}
+
+DeviceIntPtr
+GetMaster(DeviceIntPtr dev, int which)
+{
+    DeviceIntPtr master;
+
+    if (IsMaster(dev))
+        master = dev;
+    else
+        master = dev->master;
+
+    if (master)
+    {
+        if (which == MASTER_KEYBOARD)
+        {
+            if (master->type != MASTER_KEYBOARD)
+                master = GetPairedDevice(master);
+        } else
+        {
+            if (master->type != MASTER_POINTER)
+                master = GetPairedDevice(master);
+        }
+    }
+
+    return master;
+}
+
+static void
+EvdevHookPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor,
+                      BoxPtr pHotBox, BoxPtr pTopLeftBox)
+{
+    *pTopLeftBox = *pHotBox;
+}
+
+static void
+EvdevHookPointerConstrainCursor (DeviceIntPtr pDev, ScreenPtr pScreen, BoxPtr pBox)
+{
+    InputInfoPtr pInfo;
+    EvdevPtr pEvdev;
+    BoxPtr pConfineBox;
+
+    xf86IDrvMsg(pInfo, X_INFO, "[X11][EvdevHookPointerConstrainCursor] Enter !\n");
+
+    pInfo =  pDev->public.devicePrivate;
+    if(!pInfo || !pInfo->private) return;
+    pEvdev = pInfo->private;
+
+    miPointerPtr pPointer;
+    pPointer = MIPOINTER(pDev);
+
+    pConfineBox = pEvdev->pointer_confine_region;
+    if(pConfineBox && pEvdev->confined_id)
+    {
+           xf86IDrvMsg(pInfo, X_INFO, "[X11][EvdevHookPointerConstrainCursor][before] pBox (%d, %d, %d, %d), pPointer->limits (%d, %d, %d, %d), confined=%d\n",
+                       pBox->x1, pBox->y1, pBox->x2, pBox->y2, pPointer->limits.x1, pPointer->limits.y1, pPointer->limits.x2, pPointer->limits.y2, pPointer->confined);
+
+           if( IsMaster(pDev) && GetMasterPointerFromId(pEvdev->confined_id) == pDev )
+           {
+                 xf86IDrvMsg(pInfo, X_INFO, "[X11][EvdevHookPointerConstrainCursor] confine routine --begin (pDev->id=%d)\n", pDev->id);
+                 if( pBox->x1 < pConfineBox->x1 )
+                       pBox->x1 = pConfineBox->x1;
+                 if( pBox->y1 < pConfineBox->y1 )
+                       pBox->y1 = pConfineBox->y1;
+                 if( pBox->x2 > pConfineBox->x2 )
+                       pBox->x2 = pConfineBox->x2;
+                 if( pBox->y2 > pConfineBox->y2 )
+                       pBox->y2 = pConfineBox->y2;
+                 xf86IDrvMsg(pInfo, X_INFO, "[X11][EvdevHookPointerConstrainCursor] confine routine --end (pDev->id=%d)\n", pDev->id);
+           }
+    }
+
+    pPointer->limits = *pBox;
+    pPointer->confined = PointerConfinedToScreen(pDev);
+
+    if(pEvdev->confined_id)
+    {
+           xf86IDrvMsg(pInfo, X_INFO, "[X11][EvdevHookPointerConstrainCursor][after] pBox (%d, %d, %d, %d), pPointer->limits (%d, %d, %d, %d), confined=%d\n",
+                       pBox->x1, pBox->y1, pBox->x2, pBox->y2, pPointer->limits.x1, pPointer->limits.y1, pPointer->limits.x2, pPointer->limits.y2, pPointer->confined);
+    }
+
+    xf86IDrvMsg(pInfo, X_INFO, "[X11][EvdevHookPointerConstrainCursor] Leave !\n");
+}
+
+static void
+EvdevSetCursorLimits(InputInfoPtr pInfo, int region[6], int isSet)
+{
+       EvdevPtr pEvdev = pInfo->private;
+       BoxPtr pConfineBox = pEvdev->pointer_confine_region;
+       int v[2];
+       int x, y;
+
+       ScreenPtr pCursorScreen = NULL;
+
+       pCursorScreen = miPointerGetScreen(pInfo->dev);
+
+       if( !pCursorScreen )
+       {
+               xf86IDrvMsg(pInfo, X_ERROR, "[X11][SetCursorLimits] Failed to get screen information for pointer !\n");
+               return;
+       }
+
+       if( isSet )
+       {
+               xf86IDrvMsg(pInfo, X_INFO, "[X11][SetCursorLimits] isSet = TRUE !!\n");
+
+               //Clip confine region with screen's width/height
+               if( region[0] < 0 )
+                       region[0] = 0;
+               if( region[2] >= pCursorScreen->width )
+                       region[2] = pCursorScreen->width - 1;
+               if( region [1] < 0 )
+                       region[1] = 0;
+               if( region[3] >= pCursorScreen->height )
+                       region[3] = pCursorScreen->height - 1;
+
+               //Do pointerwarp if region[4] is not zero and region[5] is zero
+               if(region[4] && !region[5])
+                       goto warp_only;
+
+               pConfineBox->x1 = region[0];
+               pConfineBox->y1 = region[1];
+               pConfineBox->x2 = region[2];
+               pConfineBox->y2 = region[3];
+               pEvdev->confined_id = pInfo->dev->id;
+
+               pCursorScreen->ConstrainCursor(inputInfo.pointer, pCursorScreen, pConfineBox);
+               xf86IDrvMsg(pInfo, X_INFO, "[X11][SetCursorLimits] Constrain information for cursor was set to TOPLEFT(%d, %d) BOTTOMRIGHT(%d, %d) !\n",
+                       region[0], region[1], region[2], region[3]);
+
+               if( pCursorScreen->CursorLimits != EvdevHookPointerCursorLimits &&
+                       pCursorScreen->ConstrainCursor != EvdevHookPointerConstrainCursor)
+               {
+                       //Backup original function pointer(s)
+                       pEvdev->pOrgConstrainCursor = pCursorScreen->ConstrainCursor;
+                       pEvdev->pOrgCursorLimits = pCursorScreen->CursorLimits;
+
+                       //Overriding function pointer(s)
+                       pCursorScreen->CursorLimits = EvdevHookPointerCursorLimits;
+                       pCursorScreen->ConstrainCursor = EvdevHookPointerConstrainCursor;
+               }
+
+               //Skip pointer warp if region[4] is zero
+               if(!region[4])
+               {
+                       xf86IDrvMsg(pInfo, X_INFO, "[X11][SetCursorLimits] region[4]=%d NOT pointer warp !\n", region[4]);
+                       return;
+               }
+
+warp_only:
+               v[0] = region[0] + (int)((float)(region[2]-region[0])/2);
+               v[1] = region[1] + (int)((float)(region[3]-region[1])/2);
+
+               xf86PostMotionEventP(pInfo->dev, TRUE, REL_X, 2, v);
+               xf86IDrvMsg(pInfo, X_INFO, "[X11][SetCursorLimits] Cursor was warped to (%d, %d) !\n", v[0], v[1]);
+               miPointerGetPosition(pInfo->dev, &x, &y);
+               xf86IDrvMsg(pInfo, X_INFO, "[X11][SetCursorLimits] Cursor is located at (%d, %d) !\n", x, y);
+       }
+       else
+       {
+               xf86IDrvMsg(pInfo, X_INFO, "[X11][SetCursorLimits] isSet = FALSE !!\n");
+
+               pConfineBox->x1 = 0;
+               pConfineBox->y1 = 0;
+               pConfineBox->x2 = pCursorScreen->width - 1;
+               pConfineBox->y2 = pCursorScreen->height - 1;
+               pEvdev->confined_id = 0;
+
+               pCursorScreen->ConstrainCursor(inputInfo.pointer, pCursorScreen, pConfineBox);
+               xf86IDrvMsg(pInfo, X_INFO, "[X11][SetCursorLimits] Constrain information for cursor was restored ! TOPLEFT(%d, %d) BOTTOMRIGHT(%d, %d) !\n",
+                       pConfineBox->x1, pConfineBox->y1,
+                       pConfineBox->x2, pConfineBox->y2);
+
+               //Restore original function pointer(s)
+               pCursorScreen->CursorLimits = pEvdev->pOrgCursorLimits;
+               pCursorScreen->ConstrainCursor = pEvdev->pOrgConstrainCursor;
+       }
+}
+
+static void
+EvdevSetConfineRegion(InputInfoPtr pInfo, int num_item, int region[6])
+{
+       EvdevPtr pEvdev = pInfo ? pInfo->private : NULL;
+
+       if(!pEvdev)
+       {
+               xf86IDrvMsg(pInfo, X_ERROR, "[X11][SetConfineRegion] num_item != 6 && num_item != 1 !!\n");
+               return;
+       }
+
+       if ((num_item != 6) && (num_item != 1) )
+       {
+               xf86IDrvMsg(pInfo, X_ERROR, "[X11][SetConfineRegion] num_item != 6 && num_item != 1 !!\n");
+               return;
+       }
+
+       if (!pEvdev->pointer_confine_region)
+       {
+               xf86IDrvMsg(pInfo, X_ERROR, "[X11][SetConfineRegion] pEvdev->pointer_confine_region is NULL\n");
+               xf86IDrvMsg(pInfo, X_ERROR, "[X11][SetConfineRegion] num_item=%d\n", num_item);
+               return;
+       }
+
+       if( num_item == 6 )
+       {
+               xf86IDrvMsg(pInfo, X_INFO, "[X11][SetConfineRegion] num_item == 6\n");
+               if ( (region[2]-region[0]>0) && (region[3]-region[1]>0) )
+               {
+                       EvdevSetCursorLimits(pInfo, &region[0], 1);
+                       xf86IDrvMsg(pInfo, X_INFO, "[X11][SetConfineRegion] Confine region was set to TOPLEFT(%d, %d) BOTTOMRIGHT(%d, %d) pointerwarp=%d, confine=%d\n",
+                               region[0], region[1], region[2], region[3], region[4], region[5]);
+                       pEvdev->flags |= EVDEV_CONFINE_REGION;
+               }
+       }
+       else//if( num_item == 1 )
+       {
+               xf86IDrvMsg(pInfo, X_INFO, "[X11][SetConfineRegion] num_item == 1\n");
+               if( !region[0] && (pEvdev->flags & EVDEV_CONFINE_REGION) )
+               {
+                       EvdevSetCursorLimits(pInfo, &region[0], 0);
+                       xf86IDrvMsg(pInfo, X_INFO, "[X11][SetConfineRegion] Confine region was unset !\n");
+                       pEvdev->flags &= ~EVDEV_CONFINE_REGION;
+               }
+       }
+}
+#endif /* #ifdef _F_EVDEV_CONFINE_REGION_ */
+
+#ifdef _F_TOUCH_TRANSFORM_MATRIX_
+static void
+EvdevSetTransformMatrix(InputInfoPtr pInfo, int num_transform, float *tmatrix)
+{
+       int x, y;
+       struct pixman_transform tr;
+       EvdevPtr pEvdev = pInfo ? pInfo->private : NULL;
+
+       if(!pEvdev)
+               return;
+
+       if( (num_transform != 9) && (num_transform != 1) )
+       {
+               pEvdev->use_transform = FALSE;
+               return;
+       }
+
+       if( num_transform == 9 )
+       {
+               pEvdev->use_transform = TRUE;
+               
+               memcpy(pEvdev->transform, tmatrix, sizeof(pEvdev->transform));
+               for (y=0; y<3; y++)
+                       for (x=0; x<3; x++)
+                               tr.matrix[y][x] = pixman_double_to_fixed((double)*tmatrix++);
+               
+               pixman_transform_invert(&pEvdev->inv_transform, &tr);
+               ErrorF("[X11][EvdevSetTransformMatrix] Touch transform has been enabled !\n");
+       }
+       else if( (num_transform == 1) && (tmatrix[0] == 0) )
+       {
+               pEvdev->use_transform = FALSE;
+               ErrorF("[X11][EvdevSetTransformMatrix] Touch transform has been disabled !\n");
+       }
+}
+#endif /* #ifdef _F_TOUCH_TRANSFORM_MATRIX_ */
+
+static void
+EvdevUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+{
+    EvdevPtr pEvdev = pInfo ? pInfo->private : NULL;
+    if (pEvdev)
+    {
+        /* Release strings allocated in EvdevAddKeyClass. */
+        XkbFreeRMLVOSet(&pEvdev->rmlvo, FALSE);
+        /* Release string allocated in EvdevOpenDevice. */
+        free(pEvdev->device);
+        pEvdev->device = NULL;
+    }
+    xf86DeleteInput(pInfo, flags);
+}
+
+static int
+EvdevPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+{
+    EvdevPtr pEvdev;
+    int rc = BadAlloc;
+#ifdef _F_TOUCH_TRANSFORM_MATRIX_
+    float tr[9];
+    int num_transform = 0;
+    const char *str;
+#endif /* #ifdef _F_TOUCH_TRANSFORM_MATRIX_ */
+
+    if (!(pEvdev = calloc(sizeof(EvdevRec), 1)))
+    {
+        xf86IDrvMsg(pInfo, X_ERROR, "Failed to allocate memory for private member of pInfo !\n");
+        goto error;
+    }
+
+    pInfo->private = pEvdev;
+    pInfo->type_name = "UNKNOWN";
+    pInfo->device_control = EvdevProc;
+    pInfo->read_input = EvdevReadInput;
+    pInfo->switch_mode = EvdevSwitchMode;
+
+    rc = EvdevOpenDevice(pInfo);
+    if (rc != Success)
+        goto error;
+
+#ifdef MULTITOUCH
+    pEvdev->cur_slot = -1;
+#endif
+
+    /*
+     * We initialize pEvdev->in_proximity to 1 so that device that doesn't use
+     * proximity will still report events.
+     */
+    pEvdev->in_proximity = 1;
+    pEvdev->use_proximity = 1;
+
+    /* Grabbing the event device stops in-kernel event forwarding. In other
+       words, it disables rfkill and the "Macintosh mouse button emulation".
+       Note that this needs a server that sets the console to RAW mode. */
+    pEvdev->grabDevice = xf86CheckBoolOption(pInfo->options, "GrabDevice", 0);
+
+    /* If grabDevice is set, ungrab immediately since we only want to grab
+     * between DEVICE_ON and DEVICE_OFF. If we never get DEVICE_ON, don't
+     * hold a grab. */
+    if (!EvdevGrabDevice(pInfo, 1, 1))
+    {
+        xf86IDrvMsg(pInfo, X_WARNING, "Device may already be configured.\n");
+        rc = BadMatch;
+        goto error;
+    }
+
+    EvdevInitButtonMapping(pInfo);
+
+    if (EvdevCache(pInfo) || EvdevProbe(pInfo)) {
+        rc = BadMatch;
+        goto error;
+    }
+
+    EvdevAddDevice(pInfo);
+
+    if (pEvdev->flags & EVDEV_BUTTON_EVENTS)
+    {
+        EvdevMBEmuPreInit(pInfo);
+        Evdev3BEmuPreInit(pInfo);
+        EvdevWheelEmuPreInit(pInfo);
+        EvdevDragLockPreInit(pInfo);
+    }
+
+#ifdef MULTITOUCH
+    if (strstr(pInfo->type_name, XI_TOUCHSCREEN))
+    {
+       pEvdev->mtdev = mtdev_new_open(pInfo->fd);
+
+       if (pEvdev->mtdev)
+       {
+               pEvdev->cur_slot = pEvdev->mtdev->caps.slot.value;
+       }
+       else
+       {
+               xf86Msg(X_ERROR, "%s: Couldn't open mtdev device\n", pInfo->name);
+               return FALSE;
+       }
+    }
+    else
+    {
+       pEvdev->mtdev = NULL;
+    }
+#endif
+
+#ifdef _F_TOUCH_TRANSFORM_MATRIX_
+    pEvdev->use_transform = FALSE;
+
+    if (strstr(pInfo->type_name, XI_TOUCHSCREEN))
+    {
+        str = xf86CheckStrOption(pInfo->options, "Transform", NULL);
+
+        if (str)
+        {
+               num_transform = sscanf(str, "%f %f %f %f %f %f %f %f %f",
+                                                &tr[0], &tr[1], &tr[2],
+                                                &tr[3], &tr[4], &tr[5], 
+                                                &tr[6], &tr[7], &tr[8]);
+               if (num_transform == 9)
+                   EvdevSetTransformMatrix(pInfo, num_transform, tr);
+               else
+               {
+                   xf86Msg(X_ERROR, "%s: Insufficient transform factors (%d). Ignoring transform\n",
+                       pInfo->name, num_transform);
+               }
+        }
+    }
+#endif /* #ifdef _F_TOUCH_TRANSFORM_MATRIX_ */
+
+#ifdef _F_EVDEV_CONFINE_REGION_
+    pEvdev->confined_id = 0;
+    pEvdev->pointer_confine_region = NULL;
+
+    if (strstr(pInfo->name, XI_TOUCHPAD)
+               || strstr(pInfo->type_name, XI_MOUSE)
+               || strstr(pInfo->name, "Virtual Touchpad"))
+    {
+        pEvdev->pointer_confine_region = (BoxPtr)malloc(sizeof(BoxRec));
+
+        if (!pEvdev->pointer_confine_region)
+        {
+               xf86IDrvMsg(pInfo, X_ERROR, "Failed to allocate memory for pointer confine region\nConfine feature may not work properly.");
+               rc = BadAlloc;
+               goto error;
+        }
+        else
+        {
+               xf86IDrvMsg(pInfo, X_INFO, "Succeed to allocate memory for pointer confine region\nConfine feature will work properly.");
+        }
+
+        memset(pEvdev->pointer_confine_region, 0, sizeof(BoxRec));
+    }
+#endif /* #ifdef _F_EVDEV_CONFINE_REGION_ */
+
+#ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_
+    pEvdev->rel_move_timer = NULL;
+    pEvdev->rel_move_prop_set = 0;
+    pEvdev->rel_move_status = 0;
+#endif /* #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_ */
+
+#ifdef _F_GESTURE_EXTENSION_
+    int alloc_size = sizeof(int)*num_slots(pEvdev);
+    pEvdev->mt_status = NULL;
+
+    if (strstr(pInfo->type_name, XI_TOUCHSCREEN))
+    {
+           pEvdev->mt_status = (int *)malloc(alloc_size);
+
+           if (!pEvdev->mt_status)
+           {
+               xf86IDrvMsg(pInfo, X_ERROR, "Failed to allocate memory to maintain multitouch status !\nX Gesture driver may not work properly.\n");
+               rc = BadAlloc;
+               goto error;
+           }
+
+           memset(pEvdev->mt_status, 0, alloc_size);
+    }
+#endif /* #ifdef _F_GESTURE_EXTENSION_ */
+
+    return Success;
+
+error:
+    if ((pInfo) && (pInfo->fd >= 0))
+        close(pInfo->fd);
+    return rc;
+}
+
+_X_EXPORT InputDriverRec EVDEV = {
+    1,
+    "evdev",
+    NULL,
+    EvdevPreInit,
+    EvdevUnInit,
+    NULL,
+    evdevDefaults
+};
+
+static void
+EvdevUnplug(pointer    p)
+{
+}
+
+static pointer
+EvdevPlug(pointer      module,
+          pointer      options,
+          int          *errmaj,
+          int          *errmin)
+{
+    xf86AddInputDriver(&EVDEV, module, 0);
+    return module;
+}
+
+static XF86ModuleVersionInfo EvdevVersionRec =
+{
+    "evdev",
+    MODULEVENDORSTRING,
+    MODINFOSTRING1,
+    MODINFOSTRING2,
+    XORG_VERSION_CURRENT,
+    PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
+    ABI_CLASS_XINPUT,
+    ABI_XINPUT_VERSION,
+    MOD_CLASS_XINPUT,
+    {0, 0, 0, 0}
+};
+
+_X_EXPORT XF86ModuleData evdevModuleData =
+{
+    &EvdevVersionRec,
+    EvdevPlug,
+    EvdevUnplug
+};
+
+
+/* Return an index value for a given button event code
+ * returns 0 on non-button event.
+ */
+unsigned int
+EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code)
+{
+    switch (code)
+    {
+        /* Mouse buttons */
+        case BTN_LEFT:
+            return 1;
+        case BTN_MIDDLE:
+            return 2;
+        case BTN_RIGHT:
+            return 3;
+        case BTN_SIDE ... BTN_JOYSTICK - 1:
+            return 8 + code - BTN_SIDE;
+
+        /* Generic buttons */
+        case BTN_0 ... BTN_2:
+            return 1 + code - BTN_0;
+        case BTN_3 ... BTN_MOUSE - 1:
+            return 8 + code - BTN_3;
+
+        /* Tablet stylus buttons */
+        case BTN_TOUCH ... BTN_STYLUS2:
+            return 1 + code - BTN_TOUCH;
+
+        /* The rest */
+        default:
+            /* Ignore */
+            return 0;
+    }
+}
+
+/* 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[] = {
+    AXIS_LABEL_PROP_ABS_X,              /* 0x00 */
+    AXIS_LABEL_PROP_ABS_Y,              /* 0x01 */
+    AXIS_LABEL_PROP_ABS_Z,              /* 0x02 */
+    AXIS_LABEL_PROP_ABS_RX,             /* 0x03 */
+    AXIS_LABEL_PROP_ABS_RY,             /* 0x04 */
+    AXIS_LABEL_PROP_ABS_RZ,             /* 0x05 */
+    AXIS_LABEL_PROP_ABS_THROTTLE,       /* 0x06 */
+    AXIS_LABEL_PROP_ABS_RUDDER,         /* 0x07 */
+    AXIS_LABEL_PROP_ABS_WHEEL,          /* 0x08 */
+    AXIS_LABEL_PROP_ABS_GAS,            /* 0x09 */
+    AXIS_LABEL_PROP_ABS_BRAKE,          /* 0x0a */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_HAT0X,          /* 0x10 */
+    AXIS_LABEL_PROP_ABS_HAT0Y,          /* 0x11 */
+    AXIS_LABEL_PROP_ABS_HAT1X,          /* 0x12 */
+    AXIS_LABEL_PROP_ABS_HAT1Y,          /* 0x13 */
+    AXIS_LABEL_PROP_ABS_HAT2X,          /* 0x14 */
+    AXIS_LABEL_PROP_ABS_HAT2Y,          /* 0x15 */
+    AXIS_LABEL_PROP_ABS_HAT3X,          /* 0x16 */
+    AXIS_LABEL_PROP_ABS_HAT3Y,          /* 0x17 */
+    AXIS_LABEL_PROP_ABS_PRESSURE,       /* 0x18 */
+    AXIS_LABEL_PROP_ABS_DISTANCE,       /* 0x19 */
+    AXIS_LABEL_PROP_ABS_TILT_X,         /* 0x1a */
+    AXIS_LABEL_PROP_ABS_TILT_Y,         /* 0x1b */
+    AXIS_LABEL_PROP_ABS_TOOL_WIDTH,     /* 0x1c */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_VOLUME          /* 0x20 */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MISC,           /* undefined */
+    AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR, /* 0x30 */
+    AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR, /* 0x31 */
+    AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR, /* 0x32 */
+    AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR, /* 0x33 */
+    AXIS_LABEL_PROP_ABS_MT_ORIENTATION, /* 0x34 */
+    AXIS_LABEL_PROP_ABS_MT_POSITION_X,  /* 0x35 */
+    AXIS_LABEL_PROP_ABS_MT_POSITION_Y,  /* 0x36 */
+    AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE,   /* 0x37 */
+    AXIS_LABEL_PROP_ABS_MT_BLOB_ID,     /* 0x38 */
+    AXIS_LABEL_PROP_ABS_MT_TRACKING_ID, /* 0x39 */
+    AXIS_LABEL_PROP_ABS_MT_PRESSURE,    /* 0x3a */
+};
+
+static char* rel_labels[] = {
+    AXIS_LABEL_PROP_REL_X,
+    AXIS_LABEL_PROP_REL_Y,
+    AXIS_LABEL_PROP_REL_Z,
+    AXIS_LABEL_PROP_REL_RX,
+    AXIS_LABEL_PROP_REL_RY,
+    AXIS_LABEL_PROP_REL_RZ,
+    AXIS_LABEL_PROP_REL_HWHEEL,
+    AXIS_LABEL_PROP_REL_DIAL,
+    AXIS_LABEL_PROP_REL_WHEEL,
+    AXIS_LABEL_PROP_REL_MISC
+};
+
+static char* btn_labels[][16] = {
+    { /* BTN_MISC group                 offset 0x100*/
+        BTN_LABEL_PROP_BTN_0,           /* 0x00 */
+        BTN_LABEL_PROP_BTN_1,           /* 0x01 */
+        BTN_LABEL_PROP_BTN_2,           /* 0x02 */
+        BTN_LABEL_PROP_BTN_3,           /* 0x03 */
+        BTN_LABEL_PROP_BTN_4,           /* 0x04 */
+        BTN_LABEL_PROP_BTN_5,           /* 0x05 */
+        BTN_LABEL_PROP_BTN_6,           /* 0x06 */
+        BTN_LABEL_PROP_BTN_7,           /* 0x07 */
+        BTN_LABEL_PROP_BTN_8,           /* 0x08 */
+        BTN_LABEL_PROP_BTN_9            /* 0x09 */
+    },
+    { /* BTN_MOUSE group                offset 0x110 */
+        BTN_LABEL_PROP_BTN_LEFT,        /* 0x00 */
+        BTN_LABEL_PROP_BTN_RIGHT,       /* 0x01 */
+        BTN_LABEL_PROP_BTN_MIDDLE,      /* 0x02 */
+        BTN_LABEL_PROP_BTN_SIDE,        /* 0x03 */
+        BTN_LABEL_PROP_BTN_EXTRA,       /* 0x04 */
+        BTN_LABEL_PROP_BTN_FORWARD,     /* 0x05 */
+        BTN_LABEL_PROP_BTN_BACK,        /* 0x06 */
+        BTN_LABEL_PROP_BTN_TASK         /* 0x07 */
+    },
+    { /* BTN_JOYSTICK group             offset 0x120 */
+        BTN_LABEL_PROP_BTN_TRIGGER,     /* 0x00 */
+        BTN_LABEL_PROP_BTN_THUMB,       /* 0x01 */
+        BTN_LABEL_PROP_BTN_THUMB2,      /* 0x02 */
+        BTN_LABEL_PROP_BTN_TOP,         /* 0x03 */
+        BTN_LABEL_PROP_BTN_TOP2,        /* 0x04 */
+        BTN_LABEL_PROP_BTN_PINKIE,      /* 0x05 */
+        BTN_LABEL_PROP_BTN_BASE,        /* 0x06 */
+        BTN_LABEL_PROP_BTN_BASE2,       /* 0x07 */
+        BTN_LABEL_PROP_BTN_BASE3,       /* 0x08 */
+        BTN_LABEL_PROP_BTN_BASE4,       /* 0x09 */
+        BTN_LABEL_PROP_BTN_BASE5,       /* 0x0a */
+        BTN_LABEL_PROP_BTN_BASE6,       /* 0x0b */
+        NULL,
+        NULL,
+        NULL,
+        BTN_LABEL_PROP_BTN_DEAD         /* 0x0f */
+    },
+    { /* BTN_GAMEPAD group              offset 0x130 */
+        BTN_LABEL_PROP_BTN_A,           /* 0x00 */
+        BTN_LABEL_PROP_BTN_B,           /* 0x01 */
+        BTN_LABEL_PROP_BTN_C,           /* 0x02 */
+        BTN_LABEL_PROP_BTN_X,           /* 0x03 */
+        BTN_LABEL_PROP_BTN_Y,           /* 0x04 */
+        BTN_LABEL_PROP_BTN_Z,           /* 0x05 */
+        BTN_LABEL_PROP_BTN_TL,          /* 0x06 */
+        BTN_LABEL_PROP_BTN_TR,          /* 0x07 */
+        BTN_LABEL_PROP_BTN_TL2,         /* 0x08 */
+        BTN_LABEL_PROP_BTN_TR2,         /* 0x09 */
+        BTN_LABEL_PROP_BTN_SELECT,      /* 0x0a */
+        BTN_LABEL_PROP_BTN_START,       /* 0x0b */
+        BTN_LABEL_PROP_BTN_MODE,        /* 0x0c */
+        BTN_LABEL_PROP_BTN_THUMBL,      /* 0x0d */
+        BTN_LABEL_PROP_BTN_THUMBR       /* 0x0e */
+    },
+    { /* BTN_DIGI group                         offset 0x140 */
+        BTN_LABEL_PROP_BTN_TOOL_PEN,            /* 0x00 */
+        BTN_LABEL_PROP_BTN_TOOL_RUBBER,         /* 0x01 */
+        BTN_LABEL_PROP_BTN_TOOL_BRUSH,          /* 0x02 */
+        BTN_LABEL_PROP_BTN_TOOL_PENCIL,         /* 0x03 */
+        BTN_LABEL_PROP_BTN_TOOL_AIRBRUSH,       /* 0x04 */
+        BTN_LABEL_PROP_BTN_TOOL_FINGER,         /* 0x05 */
+        BTN_LABEL_PROP_BTN_TOOL_MOUSE,          /* 0x06 */
+        BTN_LABEL_PROP_BTN_TOOL_LENS,           /* 0x07 */
+        NULL,
+        NULL,
+        BTN_LABEL_PROP_BTN_TOUCH,               /* 0x0a */
+        BTN_LABEL_PROP_BTN_STYLUS,              /* 0x0b */
+        BTN_LABEL_PROP_BTN_STYLUS2,             /* 0x0c */
+        BTN_LABEL_PROP_BTN_TOOL_DOUBLETAP,      /* 0x0d */
+        BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP       /* 0x0e */
+    },
+    { /* BTN_WHEEL group                        offset 0x150 */
+        BTN_LABEL_PROP_BTN_GEAR_DOWN,           /* 0x00 */
+        BTN_LABEL_PROP_BTN_GEAR_UP              /* 0x01 */
+    }
+};
+
+static void EvdevInitAxesLabels(EvdevPtr pEvdev, int mode, int natoms, Atom *atoms)
+{
+    Atom atom;
+    int axis;
+    char **labels;
+    int labels_len = 0;
+
+    if (mode == Absolute)
+    {
+        labels     = abs_labels;
+        labels_len = ArrayLength(abs_labels);
+    } else if (mode == Relative)
+    {
+        labels     = rel_labels;
+        labels_len = ArrayLength(rel_labels);
+    } else
+        return;
+
+    memset(atoms, 0, natoms * sizeof(Atom));
+
+    /* Now fill the ones we know */
+    for (axis = 0; axis < labels_len; axis++)
+    {
+        if (pEvdev->axis_map[axis] == -1)
+            continue;
+
+        atom = XIGetKnownProperty(labels[axis]);
+        if (!atom) /* Should not happen */
+            continue;
+
+        atoms[pEvdev->axis_map[axis]] = atom;
+    }
+}
+
+static void EvdevInitButtonLabels(EvdevPtr pEvdev, int natoms, Atom *atoms)
+{
+    Atom atom;
+    int button, bmap;
+
+    /* First, make sure all atoms are initialized */
+    atom = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
+    for (button = 0; button < natoms; button++)
+        atoms[button] = atom;
+
+    for (button = BTN_MISC; button < BTN_JOYSTICK; button++)
+    {
+        if (EvdevBitIsSet(pEvdev->key_bitmask, button))
+        {
+            int group = (button % 0x100)/16;
+            int idx = button - ((button/16) * 16);
+
+            if ((!btn_labels[group]) || (!btn_labels[group][idx]))
+                continue;
+
+            atom = XIGetKnownProperty(btn_labels[group][idx]);
+            if (!atom)
+                continue;
+
+            /* Props are 0-indexed, button numbers start with 1 */
+            bmap = EvdevUtilButtonEventToButtonNumber(pEvdev, button) - 1;
+            if(bmap <0)
+               continue;
+
+            atoms[bmap] = atom;
+        }
+    }
+
+    /* wheel buttons, hardcoded anyway */
+    if (natoms > 3)
+        atoms[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
+    if (natoms > 4)
+        atoms[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
+    if (natoms > 5)
+        atoms[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT);
+    if (natoms > 6)
+        atoms[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT);
+}
+
+static void
+EvdevInitProperty(DeviceIntPtr dev)
+{
+    InputInfoPtr pInfo  = dev->public.devicePrivate;
+    EvdevPtr     pEvdev = pInfo->private;
+    int          rc;
+    char         *device_node;
+#ifdef _F_ENABLE_DEVICE_TYPE_PROP_
+    char         *device_type;
+#endif /* #ifdef _F_ENABLE_DEVICE_TYPE_PROP_ */
+#ifdef _F_EVDEV_CONFINE_REGION_
+    int region[6] = { 0, };
+#endif /* _F_EVDEV_CONFINE_REGION_ */
+
+    CARD32       product[2];
+
+    prop_product_id = MakeAtom(XI_PROP_PRODUCT_ID, strlen(XI_PROP_PRODUCT_ID), TRUE);
+    product[0] = pEvdev->id_vendor;
+    product[1] = pEvdev->id_product;
+    rc = XIChangeDeviceProperty(dev, prop_product_id, XA_INTEGER, 32,
+                                PropModeReplace, 2, product, FALSE);
+    if (rc != Success)
+        return;
+
+    XISetDevicePropertyDeletable(dev, prop_product_id, FALSE);
+
+    /* Device node property */
+    device_node = strdup(pEvdev->device);
+    prop_device = MakeAtom(XI_PROP_DEVICE_NODE,
+                           strlen(XI_PROP_DEVICE_NODE), TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_device, XA_STRING, 8,
+                                PropModeReplace,
+                                strlen(device_node), device_node,
+                                FALSE);
+    free(device_node);
+
+    if (rc != Success)
+        return;
+
+    XISetDevicePropertyDeletable(dev, prop_device, FALSE);
+
+#ifdef _F_ENABLE_DEVICE_TYPE_PROP_
+    /* Device node property */
+    device_type = strdup(pInfo->type_name);
+    prop_device_type = MakeAtom(XI_PROP_DEVICE_TYPE,
+                           strlen(XI_PROP_DEVICE_TYPE), TRUE);
+    rc = XIChangeDeviceProperty(dev, prop_device_type, XA_STRING, 8,
+                                PropModeReplace,
+                                strlen(device_type), device_type,
+                                FALSE);
+    free(device_type);
+
+    if (rc != Success)
+        return;
+#endif /* #ifdef _F_ENABLE_DEVICE_TYPE_PROP_ */
+
+#ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_
+    pEvdev->rel_move_status = 0;
+
+    /* Relative movement property */
+    prop_relative_move_status = MakeAtom(XI_PROP_REL_MOVE_STATUS,
+                                        strlen(XI_PROP_REL_MOVE_STATUS), TRUE);
+    prop_relative_move_ack = MakeAtom(XI_PROP_REL_MOVE_ACK,
+                                        strlen(XI_PROP_REL_MOVE_ACK), TRUE);
+
+    ErrorF("[%s] prop_relative_move_status = %d, prop_relative_move_ack = %d\n", __FUNCTION__, prop_relative_move_status, prop_relative_move_ack);
+#endif /* #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_ */
+
+    if (EvdevDeviceIsVirtual(pEvdev->device))
+    {
+        BOOL virtual = 1;
+        prop_virtual = MakeAtom(XI_PROP_VIRTUAL_DEVICE,
+                                strlen(XI_PROP_VIRTUAL_DEVICE), TRUE);
+        rc = XIChangeDeviceProperty(dev, prop_virtual, XA_INTEGER, 8,
+                                    PropModeReplace, 1, &virtual, FALSE);
+        XISetDevicePropertyDeletable(dev, prop_virtual, FALSE);
+    }
+
+#ifdef _F_EVDEV_CONFINE_REGION_
+    if (pEvdev->flags & EVDEV_RELATIVE_EVENTS)
+    {
+        prop_confine_region = MakeAtom(EVDEV_PROP_CONFINE_REGION,
+                strlen(EVDEV_PROP_CONFINE_REGION), TRUE);
+        rc = XIChangeDeviceProperty(dev, prop_confine_region, XA_INTEGER,
+                    32, PropModeReplace, 4, region, FALSE);
+                    //here
+                    //32, PropModeReplace, 6, region, FALSE);
+
+        if (rc != Success)
+            return;
+
+        XISetDevicePropertyDeletable(dev, prop_confine_region, FALSE);
+    }
+#endif /* #ifdef _F_EVDEV_CONFINE_REGION_ */
+
+#ifdef _F_TOUCH_TRANSFORM_MATRIX_
+    if (strstr(pInfo->type_name, XI_TOUCHSCREEN))
+    {
+        /* matrix to transform */
+        prop_transform = MakeAtom(EVDEV_PROP_TOUCH_TRANSFORM_MATRIX, strlen(EVDEV_PROP_TOUCH_TRANSFORM_MATRIX),  TRUE);
+        rc = XIChangeDeviceProperty(dev, prop_transform, XIGetKnownProperty(XATOM_FLOAT), 32, PropModeReplace, 9, pEvdev->transform, FALSE);
+       
+        if (rc != Success)
+            return;
+       
+        XISetDevicePropertyDeletable(dev, prop_transform, FALSE);
+    }
+#endif /* #ifdef _F_TOUCH_TRANSFORM_MATRIX_ */
+
+
+    if (pEvdev->flags & (EVDEV_RELATIVE_EVENTS | EVDEV_ABSOLUTE_EVENTS))
+    {
+        BOOL invert[2];
+        invert[0] = pEvdev->invert_x;
+        invert[1] = pEvdev->invert_y;
+
+        prop_invert = MakeAtom(EVDEV_PROP_INVERT_AXES, strlen(EVDEV_PROP_INVERT_AXES), TRUE);
+
+        rc = XIChangeDeviceProperty(dev, prop_invert, XA_INTEGER, 8,
+                PropModeReplace, 2,
+                invert, FALSE);
+        if (rc != Success)
+            return;
+
+        XISetDevicePropertyDeletable(dev, prop_invert, FALSE);
+
+        prop_calibration = MakeAtom(EVDEV_PROP_CALIBRATION,
+                strlen(EVDEV_PROP_CALIBRATION), TRUE);
+        if (pEvdev->flags & EVDEV_CALIBRATED) {
+            int calibration[4];
+
+            calibration[0] = pEvdev->calibration.min_x;
+            calibration[1] = pEvdev->calibration.max_x;
+            calibration[2] = pEvdev->calibration.min_y;
+            calibration[3] = pEvdev->calibration.max_y;
+
+            rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER,
+                    32, PropModeReplace, 4, calibration,
+                    FALSE);
+        } else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) {
+            rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER,
+                    32, PropModeReplace, 0, NULL,
+                    FALSE);
+        }
+        if (rc != Success)
+            return;
+
+        XISetDevicePropertyDeletable(dev, prop_calibration, FALSE);
+
+        prop_swap = MakeAtom(EVDEV_PROP_SWAP_AXES,
+                strlen(EVDEV_PROP_SWAP_AXES), TRUE);
+
+        rc = XIChangeDeviceProperty(dev, prop_swap, XA_INTEGER, 8,
+                PropModeReplace, 1, &pEvdev->swap_axes, FALSE);
+        if (rc != Success)
+            return;
+
+        XISetDevicePropertyDeletable(dev, prop_swap, FALSE);
+
+        /* Axis labelling */
+        if ((pEvdev->num_vals > 0) && (prop_axis_label = XIGetKnownProperty(AXIS_LABEL_PROP)))
+        {
+            int mode;
+            Atom atoms[pEvdev->num_vals];
+
+            if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS)
+                mode = Absolute;
+            else if (pEvdev->flags & EVDEV_RELATIVE_EVENTS)
+                mode = Relative;
+            else {
+                xf86IDrvMsg(pInfo, X_ERROR, "BUG: mode is neither absolute nor relative\n");
+                mode = Absolute;
+            }
+
+            EvdevInitAxesLabels(pEvdev, mode, pEvdev->num_vals, atoms);
+            XIChangeDeviceProperty(dev, prop_axis_label, XA_ATOM, 32,
+                                   PropModeReplace, pEvdev->num_vals, atoms, FALSE);
+            XISetDevicePropertyDeletable(dev, prop_axis_label, FALSE);
+        }
+        /* Button labelling */
+        if ((pEvdev->num_buttons > 0) && (prop_btn_label = XIGetKnownProperty(BTN_LABEL_PROP)))
+        {
+            Atom atoms[EVDEV_MAXBUTTONS];
+            EvdevInitButtonLabels(pEvdev, EVDEV_MAXBUTTONS, atoms);
+            XIChangeDeviceProperty(dev, prop_btn_label, XA_ATOM, 32,
+                                   PropModeReplace, pEvdev->num_buttons, atoms, FALSE);
+            XISetDevicePropertyDeletable(dev, prop_btn_label, FALSE);
+        }
+    }
+}
+
+static int
+EvdevSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
+                 BOOL checkonly)
+{
+    InputInfoPtr pInfo  = dev->public.devicePrivate;
+    EvdevPtr     pEvdev = pInfo->private;
+
+    if (atom == prop_invert)
+    {
+        BOOL* data;
+        if (val->format != 8 || val->size != 2 || val->type != XA_INTEGER)
+            return BadMatch;
+
+        if (!checkonly)
+        {
+            data = (BOOL*)val->data;
+            pEvdev->invert_x = data[0];
+            pEvdev->invert_y = data[1];
+        }
+    } else if (atom == prop_calibration)
+    {
+        if (val->format != 32 || val->type != XA_INTEGER)
+            return BadMatch;
+        if (val->size != 4 && val->size != 0)
+            return BadMatch;
+
+        if (!checkonly)
+            EvdevSetCalibration(pInfo, val->size, val->data);
+    } else if (atom == prop_swap)
+    {
+        if (val->format != 8 || val->type != XA_INTEGER || val->size != 1)
+            return BadMatch;
+
+        if (!checkonly)
+            pEvdev->swap_axes = *((BOOL*)val->data);
+    } else if (atom == prop_axis_label || atom == prop_btn_label ||
+               atom == prop_product_id || atom == prop_device ||
+#ifdef _F_ENABLE_DEVICE_TYPE_PROP_
+               atom == prop_virtual || atom == prop_device_type)
+#else /* #ifdef _F_ENABLE_DEVICE_TYPE_PROP_ */
+               atom == prop_virtual)
+#endif /* #ifdef _F_ENABLE_DEVICE_TYPE_PROP_ */
+        return BadAccess; /* Read-only properties */
+#ifdef _F_TOUCH_TRANSFORM_MATRIX_
+    else if (atom == prop_transform)
+    {
+        float *f;
+
+        if (val->format != 32 || val->type != XIGetKnownProperty(XATOM_FLOAT)
+                       || ((val->size != 9) && (val->size != 1)))
+            return BadMatch;
+        if (!checkonly) {
+            f = (float*)val->data;
+            EvdevSetTransformMatrix(pInfo, val->size, f);
+        }
+    }
+#endif /* #ifdef _F_TOUCH_TRANSFORM_MATRIX_ */
+#ifdef _F_EVDEV_CONFINE_REGION_
+    else if (atom == prop_confine_region)
+    {
+        if (val->format != 32 || val->type != XA_INTEGER)
+            return BadMatch;
+        if (val->size != 1 && val->size != 6)
+            return BadMatch;
+
+        if (!checkonly)
+            EvdevSetConfineRegion(pInfo, val->size, val->data);
+    }
+#endif /* #ifdef _F_EVDEV_CONFINE_REGION_ */
+#ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_
+    else if (atom == prop_relative_move_ack)
+    {
+        if (val->format != 8 || val->type != XA_INTEGER)
+            return BadMatch;
+        if (val->size != 1)
+            return BadMatch;
+
+        if (!checkonly)
+            pEvdev->rel_move_ack = 1;
+    }
+#endif /* _F_ENABLE_REL_MOVE_STATUS_PROP_ */
+
+
+    return Success;
+}
diff --git a/src/evdev.h b/src/evdev.h
new file mode 100755 (executable)
index 0000000..e601d11
--- /dev/null
@@ -0,0 +1,375 @@
+/*
+ * Copyright © 2004-2008 Red Hat, Inc.
+ * Copyright © 2008 University of South Australia
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of Red Hat
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.  Red
+ * Hat makes no representations about the suitability of this software
+ * for any purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors:
+ *     Kristian Høgsberg (krh@redhat.com)
+ *     Adam Jackson (ajax@redhat.com)
+ *     Peter Hutterer (peter@cs.unisa.edu.au)
+ *     Oliver McFadden (oliver.mcfadden@nokia.com)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifndef EVDEV_H
+#define EVDEV_H
+
+#include <linux/input.h>
+#include <linux/types.h>
+
+#include <xorg-server.h>
+#include <xf86Xinput.h>
+#include <xf86_OSproc.h>
+#include <xkbstr.h>
+
+#ifdef MULTITOUCH
+#include <mtdev.h>
+#endif
+
+#ifdef _F_GESTURE_EXTENSION_
+typedef enum _MTSyncType
+{
+       MTOUCH_FRAME_SYNC_END,
+       MTOUCH_FRAME_SYNC_BEGIN
+} MTSyncType;
+
+enum EventType
+{
+    ET_MTSync = 0x7E,
+    ET_Internal = 0xFF /* First byte */
+};
+
+typedef struct _AnyEvent AnyEvent;
+struct _AnyEvent
+{
+    unsigned char header; /**< Always ET_Internal */
+    enum EventType type;  /**< One of EventType */
+    int length;           /**< Length in bytes */
+    Time time;            /**< Time in ms */
+    int deviceid;
+    MTSyncType sync;
+    int x;
+    int y;
+};
+
+union _InternalEvent {
+       struct {
+           unsigned char header; /**< Always ET_Internal */
+           enum EventType type;  /**< One of ET_* */
+           int length;           /**< Length in bytes */
+           Time time;            /**< Time in ms. */
+       } any;
+       AnyEvent any_event;
+};
+#endif /* #ifdef _F_GESTURE_EXTENSION_ */
+
+#ifndef EV_CNT /* linux 2.6.23 kernels and earlier lack _CNT defines */
+#define EV_CNT (EV_MAX+1)
+#endif
+#ifndef KEY_CNT
+#define KEY_CNT (KEY_MAX+1)
+#endif
+#ifndef REL_CNT
+#define REL_CNT (REL_MAX+1)
+#endif
+#ifndef ABS_CNT
+#define ABS_CNT (ABS_MAX+1)
+#endif
+#ifndef LED_CNT
+#define LED_CNT (LED_MAX+1)
+#endif
+
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 14
+#define HAVE_SMOOTH_SCROLLING 1
+#endif
+
+#define EVDEV_MAXBUTTONS 32
+#define EVDEV_MAXQUEUE 32
+
+/* evdev flags */
+#define EVDEV_KEYBOARD_EVENTS  (1 << 0)
+#define EVDEV_BUTTON_EVENTS    (1 << 1)
+#define EVDEV_RELATIVE_EVENTS  (1 << 2)
+#define EVDEV_ABSOLUTE_EVENTS  (1 << 3)
+#define EVDEV_TOUCHPAD         (1 << 4)
+#define EVDEV_INITIALIZED      (1 << 5) /* WheelInit etc. called already? */
+#define EVDEV_TOUCHSCREEN      (1 << 6)
+#define EVDEV_CALIBRATED       (1 << 7) /* run-time calibrated? */
+#define EVDEV_TABLET           (1 << 8) /* device looks like a tablet? */
+#define EVDEV_UNIGNORE_ABSOLUTE (1 << 9) /* explicitly unignore abs axes */
+#define EVDEV_UNIGNORE_RELATIVE (1 << 10) /* explicitly unignore rel axes */
+#define EVDEV_RELATIVE_MODE    (1 << 11) /* Force relative events for devices with absolute axes */
+#ifdef _F_EVDEV_CONFINE_REGION_
+#define EVDEV_CONFINE_REGION   (1 << 12)
+#endif /* #ifdef _F_EVDEV_CONFINE_REGION_ */
+
+#ifndef MAX_VALUATORS
+#define MAX_VALUATORS 36
+#endif
+
+#ifndef XI_PROP_DEVICE_NODE
+#define XI_PROP_DEVICE_NODE "Device Node"
+#endif
+
+#ifndef XI_PROP_DEVICE_TYPE
+#define XI_PROP_DEVICE_TYPE "Device Type"
+#endif
+
+#ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_
+#define XI_PROP_REL_MOVE_STATUS "Relative Move Status"
+#define XI_PROP_REL_MOVE_ACK "Relative Move Acknowledge"
+#endif /* #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_ */
+
+#define LONG_BITS (sizeof(long) * 8)
+
+/* Number of longs needed to hold the given number of bits */
+#define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
+
+/* Function key mode */
+enum fkeymode {
+    FKEYMODE_UNKNOWN = 0,
+    FKEYMODE_FKEYS,       /* function keys send function keys */
+    FKEYMODE_MMKEYS,      /* function keys send multimedia keys */
+};
+
+enum SlotState {
+    SLOTSTATE_OPEN = 8,
+    SLOTSTATE_CLOSE,
+    SLOTSTATE_UPDATE,
+    SLOTSTATE_EMPTY,
+};
+
+enum ButtonAction {
+    BUTTON_RELEASE = 0,
+    BUTTON_PRESS = 1
+};
+
+/* axis specific data for wheel emulation */
+typedef struct {
+    int up_button;
+    int down_button;
+    int traveled_distance;
+} WheelAxis, *WheelAxisPtr;
+
+/* Event queue used to defer keyboard/button events until EV_SYN time. */
+typedef struct {
+    enum {
+        EV_QUEUE_KEY,  /* xf86PostKeyboardEvent() */
+        EV_QUEUE_BTN,  /* xf86PostButtonEvent() */
+        EV_QUEUE_PROXIMITY, /* xf86PostProximityEvent() */
+#ifdef MULTITOUCH
+        EV_QUEUE_TOUCH,        /*xf86PostTouchEvent() */
+#endif
+    } type;
+    union {
+        int key;       /* May be either a key code or button number. */
+#ifdef MULTITOUCH
+        unsigned int touch; /* Touch ID */
+#endif
+    } detail;
+    int val;   /* State of the key/button/touch; pressed or released. */
+#ifdef MULTITOUCH
+    ValuatorMask *touchMask;
+#endif
+} EventQueueRec, *EventQueuePtr;
+
+typedef struct {
+    unsigned short id_vendor;
+    unsigned short id_product;
+
+    char *device;
+    int grabDevice;         /* grab the event device? */
+
+    int num_vals;           /* number of valuators */
+    int axis_map[max(ABS_CNT, REL_CNT)]; /* Map evdev <axis> to index */
+    ValuatorMask *vals;     /* new values coming in */
+    ValuatorMask *old_vals; /* old values for calculating relative motion */
+    ValuatorMask *prox;     /* last values set while not in proximity */
+    ValuatorMask *mt_mask;
+    ValuatorMask **last_mt_vals;
+    int cur_slot;
+    enum SlotState slot_state;
+#ifdef MULTITOUCH
+    struct mtdev *mtdev;
+#endif
+
+    int flags;
+    int in_proximity;           /* device in proximity */
+    int use_proximity;          /* using the proximity bit? */
+    int num_buttons;            /* number of buttons */
+    BOOL swap_axes;
+    BOOL invert_x;
+    BOOL invert_y;
+
+    int delta[REL_CNT];
+    unsigned int abs_queued, rel_queued, prox_queued;
+
+    /* XKB stuff has to be per-device rather than per-driver */
+    XkbRMLVOSet rmlvo;
+
+    /* Middle mouse button emulation */
+    struct {
+        BOOL                enabled;
+        BOOL                pending;     /* timer waiting? */
+        int                 buttonstate; /* phys. button state */
+        int                 state;       /* state machine (see bt3emu.c) */
+        Time                expires;     /* time of expiry */
+        Time                timeout;
+    } emulateMB;
+    /* Third mouse button emulation */
+    struct emulate3B {
+        BOOL                enabled;
+        BOOL                state;       /* current state */
+        Time                timeout;     /* timeout until third button press */
+        int                 buttonstate; /* phys. button state */
+        int                 button;      /* phys button to emit */
+        int                 threshold;   /* move threshold in dev coords */
+        OsTimerPtr          timer;
+        int                 delta[2];    /* delta x/y, accumulating */
+        int                 startpos[2]; /* starting pos for abs devices */
+        int                 flags;       /* remember if we had rel or abs movement */
+    } emulate3B;
+    struct {
+       int                 meta;           /* meta key to lock any button */
+       BOOL                meta_state;     /* meta_button state */
+       unsigned int        lock_pair[EVDEV_MAXBUTTONS];  /* specify a meta/lock pair */
+       BOOL                lock_state[EVDEV_MAXBUTTONS]; /* state of any locked buttons */
+    } dragLock;
+    struct {
+        BOOL                enabled;
+        int                 button;
+        int                 button_state;
+        int                 inertia;
+        WheelAxis           X;
+        WheelAxis           Y;
+        Time                expires;     /* time of expiry */
+        Time                timeout;
+    } emulateWheel;
+    /* run-time calibration */
+    struct {
+        int                 min_x;
+        int                 max_x;
+        int                 min_y;
+        int                 max_y;
+    } calibration;
+
+    unsigned char btnmap[32];           /* config-file specified button mapping */
+
+    int reopen_attempts; /* max attempts to re-open after read failure */
+    int reopen_left;     /* number of attempts left to re-open the device */
+    OsTimerPtr reopen_timer;
+
+#ifdef _F_EVDEV_CONFINE_REGION_
+    //Backup pointer(s) for cursor
+    CursorLimitsProcPtr pOrgCursorLimits;
+    ConstrainCursorProcPtr pOrgConstrainCursor;
+
+    //Confining information
+    int confined_id;
+    BoxPtr pointer_confine_region;
+#endif /* #ifdef _F_EVDEV_CONFINE_REGION_ */
+#ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_
+    BOOL rel_move_status;
+    BOOL rel_move_prop_set;
+    BOOL rel_move_ack;
+    OsTimerPtr rel_move_timer;
+#endif /* #ifdef _F_ENABLE_REL_MOVE_STATUS_PROP_ */
+#ifdef _F_GESTURE_EXTENSION_
+    int *mt_status;
+#endif /* #ifdef _F_GESTURE_EXTENSION_ */
+
+#ifdef _F_TOUCH_TRANSFORM_MATRIX_
+    float transform[9];
+    BOOL use_transform;
+    struct pixman_transform inv_transform;
+#endif /* #ifdef _F_TOUCH_TRANSFORM_MATRIX_ */
+
+    /* Cached info from device. */
+    char name[1024];
+    unsigned long bitmask[NLONGS(EV_CNT)];
+    unsigned long key_bitmask[NLONGS(KEY_CNT)];
+    unsigned long rel_bitmask[NLONGS(REL_CNT)];
+    unsigned long abs_bitmask[NLONGS(ABS_CNT)];
+    unsigned long led_bitmask[NLONGS(LED_CNT)];
+    struct input_absinfo absinfo[ABS_CNT];
+
+    /* minor/major number */
+    dev_t min_maj;
+
+    /* Event queue used to defer keyboard/button events until EV_SYN time. */
+    int                     num_queue;
+    EventQueueRec           queue[EVDEV_MAXQUEUE];
+
+    enum fkeymode           fkeymode;
+} EvdevRec, *EvdevPtr;
+
+/* Event posting functions */
+void EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value);
+void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value);
+void EvdevQueueProximityEvent(InputInfoPtr pInfo, int value);
+#ifdef MULTITOUCH
+void EvdevQueueTouchEvent(InputInfoPtr pInfo, unsigned int touch,
+                          ValuatorMask *mask, uint16_t type);
+#endif
+void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, enum ButtonAction act);
+void EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count);
+void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
+                                  int v[MAX_VALUATORS]);
+void EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
+                                  int v[MAX_VALUATORS]);
+unsigned int EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code);
+
+/* Middle Button emulation */
+int  EvdevMBEmuTimer(InputInfoPtr);
+BOOL EvdevMBEmuFilterEvent(InputInfoPtr, int, BOOL);
+void EvdevMBEmuWakeupHandler(pointer, int, pointer);
+void EvdevMBEmuBlockHandler(pointer, struct timeval**, pointer);
+void EvdevMBEmuPreInit(InputInfoPtr);
+void EvdevMBEmuOn(InputInfoPtr);
+void EvdevMBEmuFinalize(InputInfoPtr);
+
+/* Third button emulation */
+CARD32 Evdev3BEmuTimer(OsTimerPtr timer, CARD32 time, pointer arg);
+BOOL Evdev3BEmuFilterEvent(InputInfoPtr, int, BOOL);
+void Evdev3BEmuPreInit(InputInfoPtr pInfo);
+void Evdev3BEmuOn(InputInfoPtr);
+void Evdev3BEmuFinalize(InputInfoPtr);
+void Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, int dx, int dy);
+void Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals);
+
+/* Mouse Wheel emulation */
+void EvdevWheelEmuPreInit(InputInfoPtr pInfo);
+BOOL EvdevWheelEmuFilterButton(InputInfoPtr pInfo, unsigned int button, int value);
+BOOL EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv);
+
+/* Draglock code */
+void EvdevDragLockPreInit(InputInfoPtr pInfo);
+BOOL EvdevDragLockFilterEvent(InputInfoPtr pInfo, unsigned int button, int value);
+
+void EvdevMBEmuInitProperty(DeviceIntPtr);
+void Evdev3BEmuInitProperty(DeviceIntPtr);
+void EvdevWheelEmuInitProperty(DeviceIntPtr);
+void EvdevDragLockInitProperty(DeviceIntPtr);
+void EvdevAppleInitProperty(DeviceIntPtr);
+#endif
diff --git a/xorg-evdev.pc.in b/xorg-evdev.pc.in
new file mode 100644 (file)
index 0000000..20710a6
--- /dev/null
@@ -0,0 +1,6 @@
+sdkdir=@sdkdir@
+
+Name: xorg-evdev
+Description: X.Org evdev input driver.
+Version: @PACKAGE_VERSION@
+Cflags: -I${sdkdir}