diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp b/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp index ccd997f340..ac5e758b5d 100644 --- a/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp +++ b/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp @@ -160,6 +160,11 @@ get_synaptics_movment(synaptics_cookie *cookie, mouse_movement *movement) event.wValue = wValue; event.gesture = false; + // Clickpad pretends that all clicks on the touchpad are middle clicks. + // Pass them to userspace as left clicks instead. + if (sTouchpadInfo.capClickPad) + event.buttons |= ((event_buffer[0] ^ event_buffer[3]) & 0x01); + if (sTouchpadInfo.capMiddleButton || sTouchpadInfo.capFourButtons) event.buttons |= ((event_buffer[0] ^ event_buffer[3]) & 0x01) << 2; @@ -249,9 +254,13 @@ query_capability(ps2_dev *dev) // buttons. sTouchpadInfo.nExtendedButtons = 0; sTouchpadInfo.firstExtendedButton = 0; + sTouchpadInfo.capClickPad = false; return; } + sTouchpadInfo.capClickPad = (val[0] >> 5 & 1) | (val[1] >> 0 & 1); + TRACE("SYNAPTICS: clickpad %x\n", sTouchpadInfo.capClickPad); + TRACE("SYNAPTICS: extended buttons %2x\n", val[1] >> 4 & 15); sTouchpadInfo.nExtendedButtons = val[1] >> 4 & 15; sTouchpadInfo.extendedButtonsState = 0; diff --git a/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.h b/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.h index a4dc0dbb8c..544624c8ff 100644 --- a/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.h +++ b/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.h @@ -49,6 +49,7 @@ typedef struct { bool capMultiFinger; bool capPalmDetection; bool capPassThrough; + bool capClickPad; uint8 nExtendedButtons; uint8 firstExtendedButton;