summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README12
-rw-r--r--synaptics.c22
-rw-r--r--synaptics.h6
-rw-r--r--synclient.c5
4 files changed, 40 insertions, 5 deletions
diff --git a/README b/README
index c56c267..c0bb792 100644
--- a/README
+++ b/README
@@ -79,7 +79,10 @@ MaxTapTime Int max. time (in milliseconds) for detecting a tap
MaxTapMove Int max. movement of the finger for detecting a tap
VertScrollDelta Int move distance of the finger for a scroll event
HorizScrollDelta Int move distance of the finger for a scroll event
-EdgeMotionSpeed Int edge motion speed when dragging
+EdgeMotionMinZ Int finger pressure at which minimum edge motion speed is set
+EdgeMotionMaxZ Int finger pressure at which maximum edge motion speed is set
+EdgeMotionMinSpeed Int slowest setting for edge motion speed
+EdgeMotionMaxSpeed Int fastest setting for edge motion speed
Repeater String repeater device
MinSpeed Float min. Speed factor
MaxSpeed Float max. Speed factor
@@ -133,6 +136,13 @@ The MinSpeed, MaxSpeed and AccelFactor parameters don't have any
effect on scrolling speed. Scrolling speed is determined solely from
the VertScrollDelta and HorizScrollDelta parameters.
+Edge motion speed is calculated by taking into account the amount of pressure
+applied to the touchpad. The sensitivity can be adjusted using the EdgeMotion
+parameters. If the pressure is below EdgeMotionMinZ, EdgeMotionMinSpeed is used,
+and if the pressure is greater than EdgeMotionMaxZ, EdgeMotionMaxSpeed is used.
+For a pressure value between EdgeMotionMinZ and EdgeMotionMaxZ, the speed is
+increased linearly.
+
Since synaptics touchpads don't have a button that corresponds to the
middle button on a mouse, the driver can emulate middle mouse button
events. If you press both the left and right mouse buttons at almost
diff --git a/synaptics.c b/synaptics.c
index b291c5e..6c32900 100644
--- a/synaptics.c
+++ b/synaptics.c
@@ -1,4 +1,7 @@
/*
+ * Copyright 2004 Matthias Ihmig <m.ihmig@gmx.net>
+ * patch for pressure dependent EdgeMotion speed
+ *
* Copyright 2004 Alexei Gilchrist <alexei@physics.uq.edu.au>
* patch for circular scrolling
*
@@ -328,7 +331,10 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
"EmulateMidButtonTime", 75);
priv->synpara->scroll_dist_vert = xf86SetIntOption(local->options, "VertScrollDelta", 100);
priv->synpara->scroll_dist_horiz = xf86SetIntOption(local->options, "HorizScrollDelta", 100);
- priv->synpara->edge_motion_speed = xf86SetIntOption(local->options, "EdgeMotionSpeed", 40);
+ priv->synpara->edge_motion_min_z = xf86SetIntOption(local->options, "EdgeMotionMinZ", 30);
+ priv->synpara->edge_motion_max_z = xf86SetIntOption(local->options, "EdgeMotionMaxZ", 160);
+ priv->synpara->edge_motion_min_speed = xf86SetIntOption(local->options, "EdgeMotionMinSpeed", 1);
+ priv->synpara->edge_motion_max_speed = xf86SetIntOption(local->options, "EdgeMotionMaxSpeed", 200);
priv->synpara->repeater = xf86SetStrOption(local->options, "Repeater", NULL);
priv->synpara->updown_button_scrolling = xf86SetBoolOption(local->options, "UpDownScrolling", TRUE);
priv->synpara->touchpad_off = xf86SetBoolOption(local->options, "TouchpadOff", FALSE);
@@ -1139,7 +1145,19 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState* hw)
dy = (hw->y - MOVE_HIST(2).y) / 2;
if (priv->drag || priv->draglock) {
- int edge_speed = para->edge_motion_speed;
+ int minZ = para->edge_motion_min_z;
+ int maxZ = para->edge_motion_max_z;
+ int minSpd = para->edge_motion_min_speed;
+ int maxSpd = para->edge_motion_max_speed;
+ int edge_speed;
+
+ if (hw->z <= minZ) {
+ edge_speed = minSpd;
+ } else if (hw->z >= maxZ) {
+ edge_speed = maxSpd;
+ } else {
+ edge_speed = minSpd + (hw->z - minZ) * (maxSpd - minSpd) / (maxZ - minZ);
+ }
if (edge & RIGHT_EDGE) {
dx += clamp(edge_speed - dx, 0, edge_speed);
} else if (edge & LEFT_EDGE) {
diff --git a/synaptics.h b/synaptics.h
index 1dc8bc9..c1fbe47 100644
--- a/synaptics.h
+++ b/synaptics.h
@@ -49,7 +49,11 @@ typedef struct _SynapticsSHM
int scroll_dist_vert; /* Scrolling distance in absolute coordinates */
int scroll_dist_horiz; /* Scrolling distance in absolute coordinates */
double min_speed, max_speed, accl; /* movement parameters */
- int edge_motion_speed; /* Edge motion speed when dragging */
+ int edge_motion_min_z; /* finger pressure at which minimum edge motion speed is set */
+ int edge_motion_max_z; /* finger pressure at which maximum edge motion speed is set */
+ int edge_motion_min_speed; /* slowest setting for edge motion speed */
+ int edge_motion_max_speed; /* fastest setting for edge motion speed */
+
char* repeater; /* Repeater on or off */
Bool updown_button_scrolling; /* Up/Down-Button scrolling or middle/double-click */
Bool touchpad_off; /* Switches the Touchpad off*/
diff --git a/synclient.c b/synclient.c
index 6fbdd4b..0bed07b 100644
--- a/synclient.c
+++ b/synclient.c
@@ -79,7 +79,10 @@ static struct Parameter params[] = {
DEFINE_PAR("MinSpeed", min_speed, PT_DOUBLE, 0, 1.0),
DEFINE_PAR("MaxSpeed", max_speed, PT_DOUBLE, 0, 1.0),
DEFINE_PAR("AccelFactor", accl, PT_DOUBLE, 0, 0.2),
- DEFINE_PAR("EdgeMotionSpeed", edge_motion_speed, PT_INT, 0, 400),
+ DEFINE_PAR("EdgeMotionMinZ", edge_motion_min_z, PT_INT, 1, 255),
+ DEFINE_PAR("EdgeMotionMaxZ", edge_motion_max_z, PT_INT, 1, 255),
+ DEFINE_PAR("EdgeMotionMinSpeed", edge_motion_min_speed, PT_INT, 0, 500),
+ DEFINE_PAR("EdgeMotionMaxSpeed", edge_motion_max_speed, PT_INT, 0, 500),
DEFINE_PAR("UpDownScrolling", updown_button_scrolling, PT_BOOL, 0, 1),
DEFINE_PAR("TouchpadOff", touchpad_off, PT_BOOL, 0, 1),
DEFINE_PAR("LockedDrags", locked_drags, PT_BOOL, 0, 1),