summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2002-07-06 02:57:59 +0200
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:00:51 +0200
commit0b78e3b313b2ea2712ab82c62367f05a5787adc2 (patch)
treeef70f4276ee349f6bff08f085aa50bcd5f5a504f
parente9febd174f0ee3cbdf71cf8cc860afd3ad4e40a5 (diff)
Implemented edge motion.
-rw-r--r--PARAMETER1
-rw-r--r--synaptics.c16
-rw-r--r--synaptics.h1
3 files changed, 17 insertions, 1 deletions
diff --git a/PARAMETER b/PARAMETER
index 39cd31d..aab36b7 100644
--- a/PARAMETER
+++ b/PARAMETER
@@ -9,6 +9,7 @@ FingerHigh Int max. finger pressure before beginning with movement
MaxTapTime Int max. time (time of 1/80s) 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
+EdgeMotionSpeed Int edge motion speed when dragging
Repeater String repeater device
MinSpeed Float min. Speed-factor
MaxSpeed Float max. Speed-factor
diff --git a/synaptics.c b/synaptics.c
index 3433a70..f587fc7 100644
--- a/synaptics.c
+++ b/synaptics.c
@@ -196,6 +196,7 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
priv->synpara->tap_time = xf86SetIntOption(local->options, "MaxTapTime", 20);
priv->synpara->tap_move = xf86SetIntOption(local->options, "MaxTapMove", 220);
priv->synpara->scroll_dist_vert = xf86SetIntOption(local->options, "VertScrollDelta", 100);
+ priv->synpara->edge_motion_speed = xf86SetIntOption(local->options, "EdgeMotionSpeed", 40);
priv->synpara->repeater = xf86SetStrOption(local->options, "Repeater", NULL);
s = xf86FindOptionValue(local->options, "MinSpeed");
if((!s) || (xf86sscanf(s, "%lf", &priv->synpara->min_speed) != 1))
@@ -702,7 +703,20 @@ ReadInput(LocalDevicePtr local)
dx = (-1 *
(((priv->move_hist[MOVE_HIST(1)].x + priv->move_hist[MOVE_HIST(2)].x) / 2) -
((x + priv->move_hist[MOVE_HIST(1)].x) / 2)));
-
+
+ if (priv->drag) {
+ if (edge & RIGHT_EDGE) {
+ dx += para->edge_motion_speed;
+ } else if (edge & LEFT_EDGE) {
+ dx -= para->edge_motion_speed;
+ }
+ if (edge & TOP_EDGE) {
+ dy -= para->edge_motion_speed;
+ } else if (edge & BOTTOM_EDGE) {
+ dy += para->edge_motion_speed;
+ }
+ }
+
/* speed in depence of distance/packet */
dist = move_distance( dx, dy );
speed = dist * para->accl;
diff --git a/synaptics.h b/synaptics.h
index 4ea539e..d8d2f96 100644
--- a/synaptics.h
+++ b/synaptics.h
@@ -35,6 +35,7 @@ typedef struct _SynapticsSHM {
int tap_time, tap_move; /* max. tapping-time and movement in packets and coord. */
int scroll_dist_vert; /* Scrolling distance in absolute coordinates */
double min_speed, max_speed, accl; /* movement parameters */
+ int edge_motion_speed; /* Edge motion speed when dragging */
char* repeater; /* Repeater on or off */
} SynapticsSHM, *SynapticsSHMPtr;