patch for synaptic touchpad and stick!

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

 



Hi all!

Not too long ago I sent this mail to the list (the one I have forwarded
here).  Now since I'm on holiday I had time to look into what actually
happens in gpm when this problem occurs.

>From what I gather the following happens (I think I'm right):
The function syn_process_ps2_data get's information from both the stick
and the touchpad.  This happens every other time, so, after this
function is called with information about the stick it's called again
with information about the touchpad.

So, if I hold down a stick-button the function is called with info
"button 1 is down", then it's called again with touchpad data and for
the touchpad, no button is down.  Because of this gpm releases the
button. Next time it's called, it's about the stick again and "button 1
is down" again, so gpm presses the button down again.

This means that if you hold the button down, it presses it, then
releases it, then presses it and so on.

The attached patch disables the touchpad when the sticks button is
down.  This may not be the perfect solution but I really don't think
that anyone wants to use the stick buttons and move the mouse with the
touchpad at the same time!

So, with this patch (to latest cvs) the touchpad and the stick both
works great for me!

Tavin Cole, this should also work for you since you have the exact same
laptop as I do!

Happy new years guys!

Regards,
Erik
--- Begin Message ---
Hi, I sent this mail to the list before but I think it got stuck at the
moderator since I wasn't on the list.  Now I am, so I'm resending this
message.

I just got myself a new IBM thinkpad R40 and am very happy to see that
you got support for the synaptic touchpad that I have.  Everything with
the touchpad works great.

My only problem is that this laptop also has a "stick" (or whatever they
are called in enlish) and this works great if I don't use the synaptic
driver. When I use the synaptic driver the driver sometimes thinks that
I let go of the mouse buttons when I don't.

For example, when I use the stick to drag and drop it thinks that I let
go of the mouse buttons in the middle of the drag and drops whatever I'm
dragging. Hope that makes sence. 

Has anyone else seen this? Is there anything I can do to help debug this
thing?

Thanks for a great piece of software.

Regards,
Erik
_______________________________________________
gpm mailing list
gpm@xxxxxxxxxxxxxx
http://lists.linux.it/listinfo/gpm

--- End Message ---
Index: synaptics.c
===================================================================
RCS file: /data/cvs/gpm/src/synaptics.c,v
retrieving revision 1.5
diff -u -r1.5 synaptics.c
--- synaptics.c	30 Nov 2002 13:20:10 -0000	1.5
+++ synaptics.c	22 Dec 2003 21:15:38 -0000
@@ -278,6 +278,9 @@
 
 * END BADE CODE */
 
+/* really ugly global variable that is true if a stick-button is pressed */
+int stick_pressed = 0;                                                                                 
+
 /* Prototype */
 typedef unsigned char byte;
 
@@ -1423,6 +1426,11 @@
 	tp_process_repeating_actions(state,tmp_buttons,last_stick_buttons,
 				     &last_stick_button_actions[0],stick_actions);
       } 
+      if (tmp_buttons & 0x01 || tmp_buttons & 0x02 || tmp_buttons & 0x04) {
+	  stick_pressed = 1;
+      } else {
+	  stick_pressed = 0;
+      }
 
       last_stick_buttons = tmp_buttons;
             
@@ -3210,6 +3218,7 @@
   if (wmode_enabled) {
     syn_ps2_translate_wmode_data (data, &cur_report);
     if (syn_ps2_process_extended_packets(data,&cur_report,state)) return;      
+    if (stick_pressed) return;
     syn_process_wmode_report(&cur_report);
     if (tp_find_fingers(&cur_report,state)) return;
     tp_find_gestures(&cur_report);

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