diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-07-28 10:10:26 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-20 14:28:55 +1000 |
commit | 95afbe7d48f5f592689472c0ffbcfecb7080f236 (patch) | |
tree | 02a5ce204813eb621284e4606f8458853e50e119 | |
parent | 93fbbede0cf8a55fcb3eb9037623f4821467138d (diff) | |
download | xf86-input-wacom-95afbe7d48f5f592689472c0ffbcfecb7080f236.tar.gz |
Gesture: send ctrl + scroll wheel events instead of +/-.
The number of apps supporting scroll wheel zoom events is higher than the
ones supporting ctrl +/-. And the ctrl key can be assumed on the same key
for most keyboards, leaving us with a more stable zoom gesture than the
previous approach of hardcoding the position of +/-.
Suggested-by: Ping Cheng <pinglinux@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Ping Cheng <pinglinux@gmail.com>
Conflicts:
src/wcmTouchFilter.c
-rw-r--r-- | src/wcmTouchFilter.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c index e40ea2e..dc23a61 100644 --- a/src/wcmTouchFilter.c +++ b/src/wcmTouchFilter.c @@ -397,29 +397,14 @@ static void wcmFingerZoom(WacomDevicePtr priv) /* zooming? */ if (abs(dist) > WACOM_MOTION_IN_POINT) { - for (i=0; i<(int)(((double)abs(dist)/ - (double)WACOM_MOTION_IN_POINT) + 0.5); i++) - { - /* FIXME: this hardcodes the positions of ctrl, + and - to the ones on - the us keyboard layout. Tough luck. The alternative is to run - through the XKB table and figure out where +/- are hiding. Good - luck. Gesture support is not supposed to be in the driver... - */ - int key = (dist > 0) ? 21 /*XK_plus*/ : 20 /*XK_minus*/; - wcmEmitKeycode (priv->local->dev, 37 /*XK_Control_L*/, 1); - /* zooming in */ - if (dist > 0) - { - wcmEmitKeycode (priv->local->dev, key, 1); - wcmEmitKeycode (priv->local->dev, key, 0); - } - else /* zooming out */ - { - wcmEmitKeycode (priv->local->dev, key, 1); - wcmEmitKeycode (priv->local->dev, key, 0); - } - wcmEmitKeycode (priv->local->dev, 37 /*XK_Control_L*/, 0); - } + /* FIXME: this hardcodes the positions of ctrl to the ones on + the us keyboard layout. Tough luck. The alternative is to run + through the XKB table and figure out where it's hiding. Good + luck. Gesture support is not supposed to be in the driver... + */ + wcmEmitKeycode (priv->local->dev, 37 /*XK_Control_L*/, 1); + wcmSendVerticalScrollEvent(priv, dist, 4, 5); + wcmEmitKeycode (priv->local->dev, 37 /*XK_Control_L*/, 0); /* reset initial states */ common->wcmGestureState[0] = ds[0]; |