Re: Synaptics patch 7 (new)

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

 



On 5 Jun 2002, Troy Schultz wrote:

> > > With patch7 I get the following;
> > > - Press UP directtion, window scrolls up only once(approx 5 lines), does
> > > not continue to scoll, subsequent UP presses do nothing
> > What happens if you do shifts between up and down button?
> I can press UP and get one scroll, if I release and repress UP I get
> nothing.

Try this (simple) patch. It ensures that calculation results in at
least some (part of) scrolling. It reverses the direction of the reported
buttons, and that only one direction is reported.


Peter
--
E-Mail:       pebl@xxxxxxxxxx 
Real name:    Peter Berg Larsen 
Where:        Department of Computer Science, Copenhagen Uni., Denmark
diff -c -r1.3 synaptics.c
*** synaptics.c	2002/05/31 21:14:38	1.3
--- synaptics.c	2002/06/10 02:57:30
***************
*** 204,209 ****
--- 204,210 ----
  */
  
  
+ #include <math.h>                /* ceil */
  #include <stdio.h>
  #include <stdlib.h>
  #include <unistd.h>
***************
*** 949,965 ****
    if ( scrolling_amount_left < -256*20 )
      scrolling_amount_left = -256*20;
  
    
    if (scrolling_amount_left > scrolling_speed){
      scrolling_amount_left -= scrolling_speed;
!     state->buttons |= GPM_B_DOWN;
    }else if (scrolling_amount_left < -scrolling_speed){
      scrolling_amount_left += scrolling_speed;
!     state->buttons |= GPM_B_UP;
!   }else {
!     state->buttons &= ~(GPM_B_DOWN | GPM_B_UP);
!   }
!     
  }
  
  
--- 950,964 ----
    if ( scrolling_amount_left < -256*20 )
      scrolling_amount_left = -256*20;
  
+   state->buttons &= ~(GPM_B_DOWN | GPM_B_UP);
    
    if (scrolling_amount_left > scrolling_speed){
      scrolling_amount_left -= scrolling_speed;
!     state->buttons |= GPM_B_UP;
    }else if (scrolling_amount_left < -scrolling_speed){
      scrolling_amount_left += scrolling_speed;
!     state->buttons |= GPM_B_DOWN;
!   } 
  }
  
  
***************
*** 996,1006 ****
  	status |= GPM_B_FOURTH;
  	  break;
          case Up_Button_Action:
! 	scrolling_amount_left += scrolling_button_factor * scrolling_speed;
  	status = GPM_B_UP;
            break;
          case Down_Button_Action:
! 	scrolling_amount_left -= scrolling_button_factor * scrolling_speed;
  	status = GPM_B_DOWN;
            break;
  	case Turn_On_Off_Action:
--- 995,1005 ----
  	status |= GPM_B_FOURTH;
  	  break;
          case Up_Button_Action:
! 	scrolling_amount_left += ceil(scrolling_button_factor * scrolling_speed);
  	status = GPM_B_UP;
            break;
          case Down_Button_Action:
! 	scrolling_amount_left -= ceil(scrolling_button_factor * scrolling_speed);
  	status = GPM_B_DOWN;
            break;
  	case Turn_On_Off_Action:
***************
*** 1693,1699 ****
    /* if we are scrolling then stop moving and report wheel amount. */
    if ((scrolling_enabled && is_scrolling) ||
        is_always_scrolling){
!     scrolling_amount_left += state->dy;
      state->dx = 0;
      state->dy = 0;
    }
--- 1692,1698 ----
    /* if we are scrolling then stop moving and report wheel amount. */
    if ((scrolling_enabled && is_scrolling) ||
        is_always_scrolling){
!     scrolling_amount_left -= state->dy;
      state->dx = 0;
      state->dy = 0;
    }

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