summaryrefslogtreecommitdiff
path: root/ps2comm.c
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2004-04-14 20:15:19 +0200
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:02:04 +0200
commitb8e955b4ce399ba44e60bd13f9838974eee88513 (patch)
tree8b2754dcd401b29c37dab9aa35f2d9e1c7a5687a /ps2comm.c
parent599641dbbbd9cadf68ddf8cf8ffffbc1533d4012 (diff)
Handle touchpads with a middle mouse button. Based on a 2.6
kernel patch from Dmitry Torokhov.
Diffstat (limited to 'ps2comm.c')
-rw-r--r--ps2comm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ps2comm.c b/ps2comm.c
index 0b8ca8e..c8f4c13 100644
--- a/ps2comm.c
+++ b/ps2comm.c
@@ -438,7 +438,9 @@ PrintIdent(const synapticshw_t *synhw)
if (SYN_CAP_MULTI_BUTTON_NO(*synhw))
xf86Msg(X_PROBED, " -> %d multi buttons, i.e. besides standard buttons\n",
(int)(SYN_CAP_MULTI_BUTTON_NO(*synhw)));
- else if (SYN_CAP_FOUR_BUTTON(*synhw))
+ if (SYN_CAP_MIDDLE_BUTTON(*synhw))
+ xf86Msg(X_PROBED, " -> middle button\n");
+ if (SYN_CAP_FOUR_BUTTON(*synhw))
xf86Msg(X_PROBED, " -> four buttons\n");
if (SYN_CAP_MULTIFINGER(*synhw))
xf86Msg(X_PROBED, " -> multifinger detection\n");
@@ -662,6 +664,9 @@ PS2ReadHwState(LocalDevicePtr local, synapticshw_t *synhw,
hw->right = (buf[0] & 0x02) ? 1 : 0;
if (SYN_CAP_EXTENDED(*synhw)) {
+ if (SYN_CAP_MIDDLE_BUTTON(*synhw)) {
+ hw->middle = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0;
+ }
if (SYN_CAP_FOUR_BUTTON(*synhw)) {
hw->up = ((buf[3] & 0x01)) ? 1 : 0;
if (hw->left)