diff options
author | Ping Cheng <pinglinux@gmail.com> | 2009-12-21 13:32:54 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-12-22 14:01:32 +1000 |
commit | 781bb48a2ccfb2f6c12f53bc93f5a123af65bc26 (patch) | |
tree | b60300d160e470dc515be4c782d0aca08900dab1 | |
parent | e243805faabc14826bcea227c6ed2d0a13a3467a (diff) | |
download | xf86-input-wacom-781bb48a2ccfb2f6c12f53bc93f5a123af65bc26.tar.gz |
Send horizontal scroll gesture with button 6 and 7 events
On older X servers, button 6 and 7 don't do anything special;
on X server 1.7 and later, they are being translated into left and right
scroll events. This patch changes left/right arrow to button 6/7 for
horizontal scroll events.
Signed-off-by: Ping Cheng <pinglinux@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/wcmTouchFilter.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c index 0881064..3032c0e 100644 --- a/src/wcmTouchFilter.c +++ b/src/wcmTouchFilter.c @@ -35,6 +35,8 @@ #define WCM_SCROLL_UP 5 /* vertical up */ #define WCM_SCROLL_DOWN 4 /* vertical down */ +#define WCM_SCROLL_LEFT 6 /* horizontal left */ +#define WCM_SCROLL_RIGHT 7 /* horizontal right */ /* Defines for Tap Add-a-Finger to Click */ @@ -272,13 +274,29 @@ static void xf86WcmSendHorizontalScrollEvent(WacomDevicePtr priv, { if (dist > 0) { - emitKeysym (priv->local->dev, left, 1); - emitKeysym (priv->local->dev, left, 0); + /* button down */ + xf86PostButtonEvent(priv->local->dev, + priv->flags & ABSOLUTE_FLAG, + left,1,0,priv->naxes, priv->oldX, + priv->oldY,0,0,0,0); + /* button up */ + xf86PostButtonEvent(priv->local->dev, + priv->flags & ABSOLUTE_FLAG, + left,0,0,priv->naxes, priv->oldX, + priv->oldY,0,0,0,0); } else { - emitKeysym (priv->local->dev, right, 1); - emitKeysym (priv->local->dev, right, 0); + /* button down */ + xf86PostButtonEvent(priv->local->dev, + priv->flags & ABSOLUTE_FLAG, + right,1,0,priv->naxes, priv->oldX, + priv->oldY,0,0,0,0); + /* button up */ + xf86PostButtonEvent(priv->local->dev, + priv->flags & ABSOLUTE_FLAG, + right,0,0,priv->naxes, priv->oldX, + priv->oldY,0,0,0,0); } } } @@ -348,7 +366,8 @@ static void xf86WcmFingerScroll(WacomDevicePtr priv) if (abs(dist) > WACOM_PARA_MOTION_IN_POINT) { gesture = 1; - xf86WcmSendHorizontalScrollEvent(priv, dist, XK_Left, XK_Right); + xf86WcmSendHorizontalScrollEvent(priv, dist, + WCM_SCROLL_LEFT, WCM_SCROLL_RIGHT); } } } |