Bug#428679: option to map taps separately from button
On Thu, Jun 14, 2007 at 08:56:15PM +0900, Mattia Dongili wrote:
> forwarded 428679 petero2_a_t_telia_com
> thanks
>
> On Wed, Jun 13, 2007 at 03:28:49PM +0200, Bill Allombert wrote:
> > Package: xserver-xorg-input-synaptics
> > Version: 0.14.6-1
> > Severity: wishlist
> >
> > Hello Mattia,
> >
> > I have a touchpad with only 2 buttons, and I want the following mapping
> > Tap -> button 1
> > Left button -> button 2
> > Right button -> button 3
>
> Hi, I forwarded your request upstream, in the meantime I can try
> preparing a full featured patch for it.
Any progress on that ?
the synaptics driver has about 77 options and still no way to do this very
simple setting. Should we add 3 more options LeftButton, MiddleButton and
RightButton ?
The following patch do that, and hopefully it is not reversed this time.
Cheers,
--
Bill. <ballombe@debian.org>
Imagine a large red swirl here.
--- xserver-xorg-input-synaptics-1.2.0.orig/src/synaptics.c
+++ xserver-xorg-input-synaptics-1.2.0/src/synaptics.c
@@ -460,6 +460,10 @@
}
/* set the parameters */
+ pars->left_button = xf86SetIntOption(opts, "LeftButton", 1);
+ pars->middle_button = xf86SetIntOption(opts, "MiddleButton", 2);
+ pars->right_button = xf86SetIntOption(opts, "RightButton", 3);
+
pars->left_edge = xf86SetIntOption(opts, "LeftEdge", l);
pars->right_edge = xf86SetIntOption(opts, "RightEdge", r);
pars->top_edge = xf86SetIntOption(opts, "TopEdge", t);
@@ -2190,9 +2194,9 @@
rep_buttons = ((para->updown_button_repeat ? 0x18 : 0) |
(para->leftright_button_repeat ? 0x60 : 0));
- buttons = ((hw->left ? 0x01 : 0) |
- (hw->middle ? 0x02 : 0) |
- (hw->right ? 0x04 : 0) |
+ buttons = ((hw->left ? 0x1<<(para->left_button-1) : 0) |
+ (hw->middle ? 0x1<<(para->middle_button-1) : 0) |
+ (hw->right ? 0x1<<(para->right_button-1) : 0) |
(hw->up ? 0x08 : 0) |
(hw->down ? 0x10 : 0) |
(hw->multi[2] ? 0x20 : 0) |
--- xserver-xorg-input-synaptics-1.2.0.orig/src/synapticsstr.h
+++ xserver-xorg-input-synaptics-1.2.0/src/synapticsstr.h
@@ -89,6 +89,10 @@
typedef struct _SynapticsParameters
{
/* Parameter data */
+ int left_button; /* reported value of left button */
+ int middle_button; /* reported value of middle button */
+ int right_button; /* reported value of right button */
+
int left_edge, right_edge, top_edge, bottom_edge; /* edge coordinates absolute */
int finger_low, finger_high, finger_press; /* finger detection values in Z-values */
int tap_time;
Reply to: