diff options
author | Kristian Høgsberg <krh@redhat.com> | 2005-01-18 20:18:09 +0000 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2005-01-18 20:18:09 +0000 |
commit | 319e1b28a37c3b5511f0cf8ab627f9e4f0924634 (patch) | |
tree | 56710163069167ed3840082b3dbd623eb6f38c06 /src | |
parent | Build fixes for static server. (diff) | |
download | xf86-input-evdev-319e1b28a37c3b5511f0cf8ab627f9e4f0924634.tar.gz xf86-input-evdev-319e1b28a37c3b5511f0cf8ab627f9e4f0924634.tar.bz2 xf86-input-evdev-319e1b28a37c3b5511f0cf8ab627f9e4f0924634.zip |
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).
Diffstat (limited to 'src')
-rw-r--r-- | src/evdev.c | 15 |
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; |