summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2005-01-18 20:18:09 +0000
committerKristian Høgsberg <krh@redhat.com>2005-01-18 20:18:09 +0000
commit319e1b28a37c3b5511f0cf8ab627f9e4f0924634 (patch)
tree56710163069167ed3840082b3dbd623eb6f38c06
parent4ada85ef11c56d5d998a4187d5ed1c557b7098bd (diff)
Handle horizontal wheel events and move mapping of extra buttons up so theysco_port_update-baseXORG-6_8_99_6XORG-6_8_99_5XORG-6_8_99_4XORG-6_8_99_3XORG-6_8_99_2XORG-6_8_99_1
don't overlap the wheel buttons. Patch from Alan Swanson (#968).
-rw-r--r--src/evdev.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 3a40924..462cfc8 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -67,6 +67,8 @@
static int wheel_up_button = 4;
static int wheel_down_button = 5;
+static int wheel_left_button = 6;
+static int wheel_right_button = 7;
static void
PostButtonClicks(InputInfoPtr pInfo, int button, int count)
@@ -118,6 +120,13 @@ EvdevReadInput(InputInfoPtr pInfo)
if (value < 0)
PostButtonClicks(pInfo, wheel_down_button, -value);
break;
+
+ case REL_HWHEEL:
+ if (value > 0)
+ PostButtonClicks(pInfo, wheel_right_button, value);
+ if (value < 0)
+ PostButtonClicks(pInfo, wheel_left_button, -value);
+ break;
}
break;
@@ -129,11 +138,15 @@ EvdevReadInput(InputInfoPtr pInfo)
case BTN_LEFT:
case BTN_RIGHT:
case BTN_MIDDLE:
+ xf86PostButtonEvent(pInfo->dev, 0, ev.code - BTN_LEFT + 1,
+ value, 0, 0);
+ break;
+
case BTN_SIDE:
case BTN_EXTRA:
case BTN_FORWARD:
case BTN_BACK:
- xf86PostButtonEvent(pInfo->dev, 0, ev.code - BTN_LEFT + 1,
+ xf86PostButtonEvent(pInfo->dev, 0, ev.code - BTN_LEFT + 5,
value, 0, 0);
break;