Commit 781bb48a2ccfb2f6c12f53bc93f5a123af65bc26

  • avatar
  • Peter Hutterer <peter.hutterer @wh…t.net> (Committer)
  • Tue Dec 22 05:01:32 CET 2009
  • avatar
  • Ping Cheng <pinglinux @gm…l.com> (Author)
  • Mon Dec 21 22:32:54 CET 2009
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>
  
3535
3636#define WCM_SCROLL_UP 5 /* vertical up */
3737#define WCM_SCROLL_DOWN 4 /* vertical down */
38#define WCM_SCROLL_LEFT 6 /* horizontal left */
39#define WCM_SCROLL_RIGHT 7 /* horizontal right */
3840
3941
4042/* Defines for Tap Add-a-Finger to Click */
274274 {
275275 if (dist > 0)
276276 {
277 emitKeysym (priv->local->dev, left, 1);
278 emitKeysym (priv->local->dev, left, 0);
277 /* button down */
278 xf86PostButtonEvent(priv->local->dev,
279 priv->flags & ABSOLUTE_FLAG,
280 left,1,0,priv->naxes, priv->oldX,
281 priv->oldY,0,0,0,0);
282 /* button up */
283 xf86PostButtonEvent(priv->local->dev,
284 priv->flags & ABSOLUTE_FLAG,
285 left,0,0,priv->naxes, priv->oldX,
286 priv->oldY,0,0,0,0);
279287 }
280288 else
281289 {
282 emitKeysym (priv->local->dev, right, 1);
283 emitKeysym (priv->local->dev, right, 0);
290 /* button down */
291 xf86PostButtonEvent(priv->local->dev,
292 priv->flags & ABSOLUTE_FLAG,
293 right,1,0,priv->naxes, priv->oldX,
294 priv->oldY,0,0,0,0);
295 /* button up */
296 xf86PostButtonEvent(priv->local->dev,
297 priv->flags & ABSOLUTE_FLAG,
298 right,0,0,priv->naxes, priv->oldX,
299 priv->oldY,0,0,0,0);
284300 }
285301 }
286302}
366366 if (abs(dist) > WACOM_PARA_MOTION_IN_POINT)
367367 {
368368 gesture = 1;
369 xf86WcmSendHorizontalScrollEvent(priv, dist, XK_Left, XK_Right);
369 xf86WcmSendHorizontalScrollEvent(priv, dist,
370 WCM_SCROLL_LEFT, WCM_SCROLL_RIGHT);
370371 }
371372 }
372373 }