Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wellspring Emulation #24

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft

Wellspring Emulation #24

wants to merge 30 commits into from

Conversation

1Revenger1
Copy link
Contributor

@1Revenger1 1Revenger1 commented Jan 7, 2023

Adds Wellspring Trackpad emulation for older macOS versions, allowing multitouch support down to 10.5. The original implementation is used for Sierra and newer, as it is easier to use AppleMultitouchDevice rather than trying to work around Sandbox restrictions in newer macOS versions like Ventura.

I have not had a chance yet to test in older macOS versions, though will test on my M4700 with an Alps trackpad when I get the chance.

This is still a heavy WIP, am mainly opening this to track changes for now. This does currently work in Catalina.

@usr-sse2
Copy link
Collaborator

usr-sse2 commented Jan 9, 2023

In which MacBook is Wellspring trackpad found? Is it used in modern models or it can become unsupported in the next macOS release?

@1Revenger1
Copy link
Contributor Author

These trackpads are still used in the force touch macbooks. It's the same packet layout over SPI, though they use a Report ID of 0x75 instead of 0x74. There is some added fields for the newer trackpads, but MultitouchSupport.plugin checks the length before reading these added fields.

// ContactDensity can be calculated in MultitouchSupport.plugin
/*UInt16 ContactDensity;
UInt16 Unused[2];
UInt16 Pressure; // Not a thing on Wellspring3 */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These would need to be uncommented to add pressure support, and may need to change the product ID/other device properties. As long as we give the correct sizes in the header though, older versions should still parse this fine.

@1Revenger1
Copy link
Contributor Author

1Revenger1 commented Jan 13, 2023

These trackpads are still used in the force touch macbooks. It's the same packet layout over SPI, though they use a Report ID of 0x75 instead of 0x74. There is some added fields for the newer trackpads, but MultitouchSupport.plugin checks the length before reading these added fields.

So it turns out there is a different header for the newer trackpads, but that shouldn't be too bad to handle. The finger data is the same, so that logic can be shared if needed. Ventura still supports the reports for the USB trackpads too (OCLP just reinjects AppleUSBMultitouch and doesn't touch MultitouchSupport.plugin which does the actual decoding of packets.)

I don't think they'll remove support for the older trackpads, but I'll look into what's needed to support newer trackpads. It's likely adding properties for actuator/force touch, changing product ID, sensor Params/region Params, and changing the header.

@1Revenger1
Copy link
Contributor Author

1Revenger1 commented Jan 14, 2023

This is slightly broken in Ventura (if anyone ends up trying). AppleUSBMultitouch was removed, so that dependency needs to be removed for the EventDriver. Should be an easy fix though.

Ventura works now. I'm not really sure how I feel about the workaround though. Sandbox is preventing anything other than AppleUSBMultitouch, AppleMultitouchDriver, and some other drivers from being opened by WindowServer. It does allow anything with the IOHID prefix though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants