Skip to content

Commit

Permalink
Enable Extended W mode always if supported, not only if it's a ClickPad
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Belyaev committed Apr 22, 2020
1 parent 7ca9da2 commit 8242476
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 20 deletions.
21 changes: 8 additions & 13 deletions VoodooPS2Trackpad/VoodooPS2SynapticsTouchPad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,11 @@ void ApplePS2SynapticsTouchPad::queryCapabilities()
_reportsv = (bool)(buf3[1] >> 3) & (1 << 3);
INFO_LOG("VoodooPS2Trackpad: _reportsv=%d\n", _reportsv);

// automatically set extendedwmode for clickpads, if supported
if (supportsEW && clickpadtype)
// automatically set extendedwmode if supported
if (supportsEW)
{
_extendedwmodeSupported = true;
INFO_LOG("VoodooPS2Trackpad: Clickpad supports extendedW mode\n");
INFO_LOG("VoodooPS2Trackpad: Trackpad supports extendedW mode\n");
}

reportsMax = (bool)(buf3[0] & (1 << 1));
Expand Down Expand Up @@ -1853,11 +1853,8 @@ void ApplePS2SynapticsTouchPad::initTouchPad()

bool ApplePS2SynapticsTouchPad::setTouchpadModeByte()
{
if (!_dynamicEW)
{
_touchPadModeByte = _extendedwmodeSupported ? _touchPadModeByte | (1<<2) : _touchPadModeByte & ~(1<<2);
_extendedwmode = _extendedwmodeSupported;
}
_touchPadModeByte = _extendedwmodeSupported ? _touchPadModeByte | (1<<2) : _touchPadModeByte & ~(1<<2);
_extendedwmode = _extendedwmodeSupported;
return setTouchPadModeByte(_touchPadModeByte);
}

Expand Down Expand Up @@ -2003,7 +2000,7 @@ void ApplePS2SynapticsTouchPad::setClickButtons(UInt32 clickButtons)

bool ApplePS2SynapticsTouchPad::setModeByte()
{
if (!_dynamicEW || !_extendedwmodeSupported)
if (!_extendedwmodeSupported)
return false;

_touchPadModeByte = _clickbuttons ? _touchPadModeByte | (1<<2) : _touchPadModeByte & ~(1<<2);
Expand Down Expand Up @@ -2094,7 +2091,6 @@ void ApplePS2SynapticsTouchPad::setParamPropertiesGated(OSDictionary * config)
{"HWResetOnStart", &hwresetonstart},
{"ClickPadTrackBoth", &clickpadtrackboth},
{"FakeMiddleButton", &_fakemiddlebutton},
{"DynamicEWMode", &_dynamicEW},
{"ProcessUSBMouseStopsTrackpad", &_processusbmouse},
{"ProcessBluetoothMouseStopsTrackpad", &_processbluetoothmouse},
};
Expand Down Expand Up @@ -2163,9 +2159,8 @@ void ApplePS2SynapticsTouchPad::setParamPropertiesGated(OSDictionary * config)

// this driver assumes wmode is available (6-byte packets)
_touchPadModeByte |= 1<<0;
// extendedwmode is optional, used automatically for ClickPads
if (!_dynamicEW)
_touchPadModeByte = _extendedwmodeSupported ? _touchPadModeByte | (1<<2) : _touchPadModeByte & ~(1<<2);
// extendedwmode is optional, used automatically
_touchPadModeByte = _extendedwmodeSupported ? _touchPadModeByte | (1<<2) : _touchPadModeByte & ~(1<<2);
// if changed, setup touchpad mode
if (_touchPadModeByte != oldmode)
{
Expand Down
1 change: 0 additions & 1 deletion VoodooPS2Trackpad/VoodooPS2SynapticsTouchPad.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ class EXPORT ApplePS2SynapticsTouchPad : public IOHIPointing
// state related to secondary packets/extendedwmode
bool tracksecondary {false};
bool _extendedwmode {false}, _extendedwmodeSupported {false};
int _dynamicEW {0};

// normal state
UInt32 passbuttons {0};
Expand Down
6 changes: 0 additions & 6 deletions VoodooPS2Trackpad/VoodooPS2Trackpad-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,6 @@
<false/>
<key>DisableLEDUpdating</key>
<false/>
<key>DynamicEWMode</key>
<false/>
<key>FakeMiddleButton</key>
<true/>
<key>FingerChangeIgnoreDeltas</key>
Expand Down Expand Up @@ -299,8 +297,6 @@
<string>Thinkpad_ClickPad</string>
<key>Thinkpad_ClickPad</key>
<dict>
<key>DynamicEWMode</key>
<false/>
<key>EdgeBottom</key>
<integer>0</integer>
<key>FakeMiddleButton</key>
Expand Down Expand Up @@ -328,8 +324,6 @@
</dict>
<key>Thinkpad_TrackPad</key>
<dict>
<key>DynamicEWMode</key>
<false/>
<key>FakeMiddleButton</key>
<false/>
<key>FingerZ</key>
Expand Down

0 comments on commit 8242476

Please sign in to comment.