summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Hung <ahung@isisview.org>2012-04-13 01:04:38 -0400
committerPeter Hutterer <peter.hutterer@who-t.net>2012-04-16 11:44:14 +1000
commit1874094f0e99d8db319f6cf769ce5a25c9bc490c (patch)
tree6a349556129e3a436aa8bcc86248d389ad4bebd3
parent38b93b71c812c6d7b7085f40d049b0a4927e52dd (diff)
Support inverted scroll direction.
This patch allows scroll direction to be inverted by allowing VertScrollDelta and HorizScrollDelta to be set to negative values. This enables behaviour that is consistent with modern touchscreen devices, where the content scrolls in the same direction as the user's finger movement. Signed-off-by: Alyssa Hung <ahung@isisview.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--man/synaptics.man3
-rw-r--r--src/synaptics.c4
-rw-r--r--tools/synclient.c4
3 files changed, 7 insertions, 4 deletions
diff --git a/man/synaptics.man b/man/synaptics.man
index 864a95f..2cbe50e 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -634,6 +634,9 @@ HorizScrollDelta parameters.
634To disable vertical or horizontal scrolling, set VertScrollDelta or 634To disable vertical or horizontal scrolling, set VertScrollDelta or
635HorizScrollDelta to zero. 635HorizScrollDelta to zero.
636. 636.
637To invert the direction of vertical or horizontal scrolling, set
638VertScrollDelta or HorizScrollDelta to a negative value.
639.
637.LP 640.LP
638Acceleration is mostly handled outside the driver, thus the driver will 641Acceleration is mostly handled outside the driver, thus the driver will
639translate MinSpeed into constant deceleration and adapt MaxSpeed at 642translate MinSpeed into constant deceleration and adapt MaxSpeed at
diff --git a/src/synaptics.c b/src/synaptics.c
index fd6eb73..40478ec 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2558,14 +2558,14 @@ HandleScrolling(SynapticsPrivate *priv, struct SynapticsHwState *hw,
2558 2558
2559 if (priv->vert_scroll_edge_on || priv->vert_scroll_twofinger_on) { 2559 if (priv->vert_scroll_edge_on || priv->vert_scroll_twofinger_on) {
2560 /* + = down, - = up */ 2560 /* + = down, - = up */
2561 if (para->scroll_dist_vert > 0 && hw->y != priv->scroll.last_y) { 2561 if (para->scroll_dist_vert != 0 && hw->y != priv->scroll.last_y) {
2562 priv->scroll.delta_y += (hw->y - priv->scroll.last_y); 2562 priv->scroll.delta_y += (hw->y - priv->scroll.last_y);
2563 priv->scroll.last_y = hw->y; 2563 priv->scroll.last_y = hw->y;
2564 } 2564 }
2565 } 2565 }
2566 if (priv->horiz_scroll_edge_on || priv->horiz_scroll_twofinger_on) { 2566 if (priv->horiz_scroll_edge_on || priv->horiz_scroll_twofinger_on) {
2567 /* + = right, - = left */ 2567 /* + = right, - = left */
2568 if (para->scroll_dist_horiz > 0 && hw->x != priv->scroll.last_x) { 2568 if (para->scroll_dist_horiz != 0 && hw->x != priv->scroll.last_x) {
2569 priv->scroll.delta_x += (hw->x - priv->scroll.last_x); 2569 priv->scroll.delta_x += (hw->x - priv->scroll.last_x);
2570 priv->scroll.last_x = hw->x; 2570 priv->scroll.last_x = hw->x;
2571 } 2571 }
diff --git a/tools/synclient.c b/tools/synclient.c
index aef719f..6c8ee7a 100644
--- a/tools/synclient.c
+++ b/tools/synclient.c
@@ -90,8 +90,8 @@ static struct Parameter params[] = {
90 {"EmulateMidButtonTime", PT_INT, 0, 1000, SYNAPTICS_PROP_MIDDLE_TIMEOUT,32, 0}, 90 {"EmulateMidButtonTime", PT_INT, 0, 1000, SYNAPTICS_PROP_MIDDLE_TIMEOUT,32, 0},
91 {"EmulateTwoFingerMinZ", PT_INT, 0, 1000, SYNAPTICS_PROP_TWOFINGER_PRESSURE, 32, 0}, 91 {"EmulateTwoFingerMinZ", PT_INT, 0, 1000, SYNAPTICS_PROP_TWOFINGER_PRESSURE, 32, 0},
92 {"EmulateTwoFingerMinW", PT_INT, 0, 15, SYNAPTICS_PROP_TWOFINGER_WIDTH, 32, 0}, 92 {"EmulateTwoFingerMinW", PT_INT, 0, 15, SYNAPTICS_PROP_TWOFINGER_WIDTH, 32, 0},
93 {"VertScrollDelta", PT_INT, 0, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 0}, 93 {"VertScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 0},
94 {"HorizScrollDelta", PT_INT, 0, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 1}, 94 {"HorizScrollDelta", PT_INT, -1000, 1000, SYNAPTICS_PROP_SCROLL_DISTANCE, 32, 1},
95 {"VertEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 0}, 95 {"VertEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 0},
96 {"HorizEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 1}, 96 {"HorizEdgeScroll", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 1},
97 {"CornerCoasting", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 2}, 97 {"CornerCoasting", PT_BOOL, 0, 1, SYNAPTICS_PROP_SCROLL_EDGE, 8, 2},