Synaptic scrolling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey,

Here is a patch that fixes som unconveniences with the scrolling on the
synaptic pad.

Scrolling up and down was conterintuitive, and responded to quickly to be
usefull. I have added a option to regulate the speed.


Peter
--
E-Mail:       pebl@xxxxxxxxxx 
Real name:    Peter Berg Larsen 
Where:        Department of Computer Science, Copenhagen Uni., Denmark

--- ../../gpm-1.20.0_old/src/synaptics.c	Fri Mar 29 14:08:20 2002
+++ ./synaptics.c	Fri Mar 29 13:50:31 2002
@@ -312,6 +312,7 @@
 static int   touch_pad_enabled       = 1; /* Disable the touch pad, see corner action turn_on_off. C*/
 static int   scrolling_enabled       = 1; /* Simulate wheel mouse in at the right edge             C*/
 static int   scrolling_edge          = RIGHT_EDGE; /* Which edge is a the scrolling edge           C*/
+static int   scrolling_speed         = 4; /* less is faster, 0 fastest */
 static int   auto_scrolling_enabled  = 1; /* Moving to the upper/lower edge keeps scrolling up/downC*/
 
 /*
@@ -415,6 +416,7 @@
   { "stick_enabled",	          Flag_Param,    {&stick_enabled	      }},
   { "scrolling_enabled",	  Flag_Param,    {&scrolling_enabled	      }},
   { "scrolling_edge",	          Integer_Param, {&scrolling_edge	      }},
+  { "scrolling_speed",	          Integer_Param, {&scrolling_speed	      }},
   { "auto_scrolling_enabled",	  Flag_Param,    {&auto_scrolling_enabled     }},
   /* end of list */
   { NULL,                         Flag_Param,    {NULL                        }}
@@ -639,7 +641,7 @@
 
 /* Scrolling information */
 static int           is_scrolling = 0;
-
+static int           scrolling_speed_timer = 0;
 /****************************************************************************
 **
 ** ROUTINES for processing either type of touchpad.
@@ -1395,15 +1397,24 @@
     /* no fingers therefore: no edge, and restart packet count */
     was_non_edge = 0;
     is_scrolling = 0;
+    scrolling_speed_timer = 0;
     packet_num = 0;
   }
 
-  /* if we are scrolling then stop moving and report wheel. */
+  /* if we are scrolling then stop moving and report wheel.
+  *  The wheel is way too fast to be usefull, so only report every 
+  *  scrolling_speed. */
   if (scrolling_enabled && is_scrolling){
+    if (scrolling_speed_timer > 0){
+      scrolling_speed_timer--;
+    }else{
+      scrolling_speed_timer = scrolling_speed;
+
     if (state->dy > 0)
-      state->buttons |= GPM_B_UP;
-    else if (state->dy < 0)
       state->buttons |= GPM_B_DOWN;
+      else if (state->dy < 0)
+	state->buttons |= GPM_B_UP;
+    }
 
     state->dx = 0;
     state->dy = 0;
@@ -1416,7 +1427,7 @@
     state->dy = toss_speed.y;
   }
   
-  /* check for buttons if we didn't just complete a toss or is scrolling */
+  /* check for (corner)buttons if we didn't just complete a toss or is scrolling */
   if (!is_tossing && !was_tossing && !is_scrolling) {
     /*
     ** If there is no gesture then there are no buttons.
@@ -1474,7 +1485,7 @@
   last_state    = *state;
 
   /* Dont do anything if the pad is not enabled, but after corner actions are
-   * done so it can be turn on again */
+   * done so it can be turn on again. */
   if (!touch_pad_enabled){
     state->buttons = GPM_B_NONE;
     state->dx      = 0;

[Index of Archives]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Gimp]     [Yosemite News]