summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ps2comm.c7
-rw-r--r--ps2comm.h1
2 files changed, 7 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)
diff --git a/ps2comm.h b/ps2comm.h
index b78adb9..d7d475a 100644
--- a/ps2comm.h
+++ b/ps2comm.h
@@ -14,6 +14,7 @@
/* synaptics model ID bits */
#define SYN_MODEL_ROT180(synhw) ((synhw).model_id & (1 << 23))
#define SYN_MODEL_PORTRAIT(synhw) ((synhw).model_id & (1 << 22))
+#define SYN_CAP_MIDDLE_BUTTON(synhw) ((synhw).model_id & (1 << 18))
#define SYN_MODEL_SENSOR(synhw) (((synhw).model_id >> 16) & 0x3f)
#define SYN_MODEL_HARDWARE(synhw) (((synhw).model_id >> 9) & 0x7f)
#define SYN_MODEL_NEWABS(synhw) ((synhw).model_id & (1 << 7))