diff options
author | Peter Osterlund <petero2@telia.com> | 2003-05-02 12:20:47 +0200 |
---|---|---|
committer | Peter Osterlund <petero2@telia.com> | 2006-04-09 04:00:54 +0200 |
commit | 3db42d5b33662dbda6f0dde6cdb34748a254884f (patch) | |
tree | e712d95e54820008215c5927c5b5445da18061c9 | |
parent | 6c239a6988d0742f71aa5dd2205659f48196facc (diff) |
Merged 6 button support from 0.11.3, but only activate it
for firmware version 5.8 and later. (Everything from 0.11.3 is now
merged.)
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | synaptics.c | 50 | ||||
-rw-r--r-- | synaptics.h | 5 |
3 files changed, 46 insertions, 13 deletions
@@ -1,2 +1,6 @@ +09.06.02 - Version 0.11.1 +- new packet format for Firmware 5.8 and others; solves problems with some + models with 6 buttons (S. Lehner <sam_x@bluemail.ch>) + 13.10.01 - Version 0.10 - multifinger taps diff --git a/synaptics.c b/synaptics.c index ea5b253..0550bd9 100644 --- a/synaptics.c +++ b/synaptics.c @@ -3,6 +3,9 @@ * patches for fast scrolling, plam detection, dege motion, * hozizontal scrolling * + * 2002 S. Lehner <sam_x@bluemail.ch> + * for newer Firmware (5.8) protocol changes for 3rd to 6th button + * * Copyright (C) 2001 Stefan Gmeiner <riddlebox@freesurf.ch> * start merging tpconfig and gpm code to a xfree-input modul * adding some changes and extensions (ex. 3rd and 4th button) @@ -510,7 +513,7 @@ ReadInput(LocalDevicePtr local) Bool finger; int x, y, z, w, dist, dx, dy, buttons, id; edge_type edge; - Bool left, mid, right, up, down; + Bool left, mid, right, up, down, cbLeft, cbRight; double speed, integral; int change; int scroll_up, scroll_down, scroll_left, scroll_right; @@ -545,14 +548,31 @@ ReadInput(LocalDevicePtr local) right = (priv->protoBuf[0] & 0x2) ? TRUE : FALSE; up = FALSE; down = FALSE; - if(SYN_CAP_EXTENDED(priv->capabilities) && - (SYN_CAP_FOUR_BUTTON(priv->capabilities))) { - up = ((priv->protoBuf[3] & 0x01)) ? TRUE : FALSE; - if (left) - up = !up; - down = ((priv->protoBuf[3] & 0x02)) ? TRUE : FALSE; - if (right) - down = !down; + if (!priv->six_buttons) + { + if(SYN_CAP_EXTENDED(priv->capabilities) && + (SYN_CAP_FOUR_BUTTON(priv->capabilities))) { + up = ((priv->protoBuf[3] & 0x01)) ? TRUE : FALSE; + if (left) + up = !up; + down = ((priv->protoBuf[3] & 0x02)) ? TRUE : FALSE; + if (right) + down = !down; + } + } + else + { /* type with 6 buttons */ + if (priv->protoBuf[3] == 0xC2) + { + cbLeft = (priv->protoBuf[4] & 0x02) ? TRUE : FALSE; + cbRight = (priv->protoBuf[5] & 0x02) ? TRUE : FALSE; + up = (priv->protoBuf[4] & 0x01) ? TRUE : FALSE; + down = (priv->protoBuf[5] & 0x01) ? TRUE : FALSE; + } + else + { + cbLeft = cbRight = up = down = FALSE; + } } edge = edge_detection(priv, x, y); @@ -1086,6 +1106,14 @@ QueryHardware (LocalDevicePtr local) SYN_BIT_W_MODE) != Success) return !Success; + priv->six_buttons = FALSE; + if ((SYN_ID_MAJOR(priv->identity) > 5) || + ((SYN_ID_MAJOR(priv->identity) == 5) && (SYN_ID_MINOR(priv->identity) >= 8))) + { + xf86Msg(X_PROBED, "Using 6 button protocol\n"); + priv->six_buttons = TRUE; + } + SynapticsEnableDevice(local->fd); PrintIdent(priv); @@ -1167,8 +1195,8 @@ SynapticsGetPacket(LocalDevicePtr local, SynapticsPrivatePtr priv) } static void -PrintIdent(SynapticsPrivatePtr priv) { - +PrintIdent(SynapticsPrivatePtr priv) +{ xf86Msg(X_PROBED, " Synaptics Touchpad, model: %d\n", SYN_ID_MODEL(priv->identity)); xf86Msg(X_PROBED, " Firware: %d.%d\n", SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity)); diff --git a/synaptics.h b/synaptics.h index e9f9c53..facf242 100644 --- a/synaptics.h +++ b/synaptics.h @@ -18,7 +18,7 @@ typedef struct _SynapticsSHM unsigned long int model_id; /* Model-ID */ unsigned long int capabilities; /* Capabilities */ unsigned long int identity; /* Identification */ - Bool isSynaptics; /* Synaptics touchpad aktiv */ + Bool isSynaptics; /* Synaptics touchpad active */ /* Parameter data */ int left_edge, right_edge, top_edge, bottom_edge; @@ -70,7 +70,8 @@ typedef struct _SynapticsPrivateRec unsigned long int model_id; /* Model-ID */ unsigned long int capabilities; /* Capabilities */ unsigned long int identity; /* Identification */ - Bool isSynaptics; /* Synaptics touchpad aktiv */ + Bool isSynaptics; /* Synaptics touchpad active */ + Bool six_buttons; /* */ /* Data for normal processing */ XISBuffer *buffer; |