[haiku-commits] r42329 - haiku/trunk/src/add-ons/kernel/bus_managers/ps2

  • From: zharik@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 27 Jun 2011 20:19:46 +0200 (CEST)

Author: siarzhuk
Date: 2011-06-27 20:19:45 +0200 (Mon, 27 Jun 2011)
New Revision: 42329
Changeset: https://dev.haiku-os.org/changeset/42329

Modified:
   haiku/trunk/src/add-ons/kernel/bus_managers/ps2/movement_maker.h
   haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp
   haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.h
Log:
Proper handling of middle mouse event on capFourButtons and capMiddleButton
capable touchpads.


Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ps2/movement_maker.h
===================================================================
--- haiku/trunk/src/add-ons/kernel/bus_managers/ps2/movement_maker.h    
2011-06-27 03:11:35 UTC (rev 42328)
+++ haiku/trunk/src/add-ons/kernel/bus_managers/ps2/movement_maker.h    
2011-06-27 18:19:45 UTC (rev 42329)
@@ -96,7 +96,8 @@
 {
        kNoButton = 0x00,
        kLeftButton = 0x01,
-       kRightButton = 0x02     
+       kRightButton = 0x02,
+       kMiddleButton = 0x04
 };
 
 

Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp   
2011-06-27 03:11:35 UTC (rev 42328)
+++ haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.cpp   
2011-06-27 18:19:45 UTC (rev 42329)
@@ -123,6 +123,9 @@
 
                event.wValue = wValue;
                event.gesture = false;
+
+               if (sTouchpadInfo.capMiddleButton || 
sTouchpadInfo.capFourButtons)
+                       event.buttons |= ((event_buffer[0] ^ event_buffer[3]) & 
0x01) << 2;
        } else {
                bool finger = event_buffer[0] >> 5 & 1;
                if (finger) {
@@ -160,6 +163,8 @@
 
        sTouchpadInfo.capExtended = val[0] >> 7 & 1;
        TRACE("SYNAPTICS: extended mode %2x\n", val[0] >> 7 & 1);
+       TRACE("SYNAPTICS: middle button %2x\n", val[0] >> 2 & 1);
+       sTouchpadInfo.capMiddleButton = val[0] >> 2 & 1;
        TRACE("SYNAPTICS: sleep mode %2x\n", val[2] >> 4 & 1);
        sTouchpadInfo.capSleep = val[2] >> 4 & 1;
        TRACE("SYNAPTICS: four buttons %2x\n", val[2] >> 3 & 1);

Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.h
===================================================================
--- haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.h     
2011-06-27 03:11:35 UTC (rev 42328)
+++ haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_synaptics.h     
2011-06-27 18:19:45 UTC (rev 42329)
@@ -43,6 +43,7 @@
        uint8 minorVersion;
 
        bool capExtended;
+       bool capMiddleButton;
        bool capSleep;
        bool capFourButtons;
        bool capMultiFinger;


Other related posts: