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

Enable USB precision touchpad support #48

Merged
merged 3 commits into from
Feb 3, 2022
Merged

Conversation

Kethen
Copy link
Contributor

@Kethen Kethen commented Jan 26, 2021

On bigsur 11.1 along with the current master branch of VoodooI2C, digitiser.input_mode->setValue(INPUT_MODE_TOUCHPAD); works on both I2C(lenovo yoga530) and USB(keyboard dock for a acer switch 11v sw5-173), with one quirk being the 3 points touch usb touchpad does not show up in system preference->trackpad and I have yet to figure out why (after some reading probably due to the unpatched broadwell acpi battery not working)

existing implementation utilizing hid_interface->setReport does not work on USB; touchpad does not enter touchpad mode hence sending 0 coordinates only, hotplugging the keyboard dock causing the whole dock to stop functioning, while digitiser.input_mode->setValue works on both my I2C and USB touchpads

@jlempen
Copy link

jlempen commented Jan 28, 2021

Hi @Kethen,
Thank you so much for this!
I can confirm that your commit works perfectly for the Synaptics USB trackpad found in the detachable keyboard dock of my Lenovo ThinkPad X1 Tablet Gen 3, as well as for the USB trackpad found in the detachable type cover of my Microsoft Surface Go 2 (the highest end model with the m3-8100Y processor). I'm still on Catalina 10.5.7 on both tablets. Without your commit, both trackpads won't work at all with VoodooI2C & the VoodooI2CHID satellite and work as a simple mouse if I remove the VoodooI2C kexts entirely (or use Karabiner Elements to handle them). VoodooI2C actually detects the precision trackpads and seems to activate them, but they won't work at all.
As I don't have any device with an I2C trackpad on hand, I'm afraid I won't be able to help you check if the commit won't break other I2C trackpads, though.
I confirm as well that the I2C touchscreens handled by VoodooI2CHID keep working on both tablets with your commit. The touchscreen is a Synaptics on the Lenovo and an ELAN on the Microsoft tablet.
I have working battery status on both tablets and therefore the trackpad settings appear in system preferences. They appear to be shared with the touchscreen, though. That's the same issue as when you use a Magic Trackpad or Magic Mouse on a MacBook. The internal trackpad and the Magic Trackpad share the same settings.
Please tell me if you need more information, logs or anything to help you getting this commit merged.

@kprinssu kprinssu requested a review from ben9923 January 28, 2021 18:47
@ben9923
Copy link
Member

ben9923 commented Feb 12, 2021

@Kethen Thanks!
We definitely need some more I2C precision trackpad testers for this one before releasing it, to make sure we don't break anything.

@zhen-zen
Copy link
Contributor

zhen-zen commented Feb 20, 2021

Congrats you found a better implementation.

Don't own my old tablet with USB PTP topcase any more. iirc if I just remove Transport restriction from VoodooI2CPrecisionTouchpadHIDEventDriver (or VoodooI2CMultitouchHIDEventDriver by default), the touchpad would enter PTP mode with or without enterPrecisionTouchpadMode() but won't respond to any touch events. I wonder if it's the same case as yours.

Without VoodooI2C (sometimes I need to add the same Transport match to prevent VoodooI2CMultitouchHIDEventDriver from attaching), it will just behave like a single mouse as @jlempen said above.

Just gave it a try on a discrete USB PTP touchpad bought recently, but it still won't work. The good news is, setValue() seems to work since the trackpad will no longer output fake key combos, i.e. three finger swipe converted to a series of Win (option) + left/right arrow. So it stops reporting in compatible mode, which is usual for such gadgets. However, I don't have much time to play with it right now to dig in further.

@ghost
Copy link

ghost commented Apr 5, 2021

Hello @Kethen ,
I've tested this driver on the HP Elite X2 G4 trackpad, which is provided by ELAN instead of Synaptics (as for the case of X1 Tablet Evo). When the Multitouch HID Event Driver is being used, the trackpad does not work at all. I wonder if you wouldn't mind helping ELAN trackpad users. Another case showing the same symptom can be found here: https://github.com/acai66/lenovo-miix-520-hackintosh

@kprinssu
Copy link
Collaborator

@Xiashangning @jlempen Please keep the discussion to VoodooI2C. Can you please take the discussion of Hackintosh off-here please?

@VoodooI2C VoodooI2C deleted a comment from fenglinnet Apr 19, 2021
@VoodooI2C VoodooI2C deleted a comment from jlempen Apr 19, 2021
@VoodooI2C VoodooI2C deleted a comment from Xiashangning Apr 19, 2021
@kingo132
Copy link

kingo132 commented May 1, 2021

Hi, thanks for this fix. My surface go 2's trackpad is now working. But the acceleration seems too fast, it's very hard to click an item, even a small move will make the cursor move across the entire screen. I set the trackpad speed to zero in system preference. Still didn't help much. Do you have any clue about how to fix this trackpad acceleration or speed?

@kingo132
Copy link

kingo132 commented May 2, 2021

I think I found the reason, the physical_max is multiplied by 10 in VoodooI2CHID. This gives the result of 95.5x53.08cm size of the trackpad of surface type cover of surface go2, the actual size of it is 9.55x5.38cm.
image
This line should be removed. I don't know if it was only applied to surface go2. Or maybe it is a bug.

@kprinssu
Copy link
Collaborator

kprinssu commented May 3, 2021

@kingo132 That change was added to fix scaling issues across other hardware. The driver (or this patch) should report units in mm not cm. Hence why you see the scaling by a factor of 10.

We can consider adding a quirk where we remove the scaling if matches some array of vendor ids and product ids; though this is a hack.

@VoodooI2C VoodooI2C deleted a comment from kingo132 May 6, 2021
@kprinssu
Copy link
Collaborator

kprinssu commented May 6, 2021

@kingo132 Please keep discussions to VoodooI2C and the PR at hand. This is to keep the discussions easier to read through and less cluttered. Please contact the original some other way regarding general Hackintosh questions.

@Kethen
Copy link
Contributor Author

Kethen commented May 19, 2021

@lulujyc

Hello @Kethen ,
I've tested this driver on the HP Elite X2 G4 trackpad, which is provided by ELAN instead of Synaptics (as for the case of X1 Tablet Evo). When the Multitouch HID Event Driver is being used, the trackpad does not work at all. I wonder if you wouldn't mind helping ELAN trackpad users. Another case showing the same symptom can be found here: https://github.com/acai66/lenovo-miix-520-hackintosh

sorry I don't have such hardware and currently I don't even have access to the keyboard dock tablet so I can't bang my head against those :(

@ghost
Copy link

ghost commented May 21, 2021

@lulujyc

Hello @Kethen ,
I've tested this driver on the HP Elite X2 G4 trackpad, which is provided by ELAN instead of Synaptics (as for the case of X1 Tablet Evo). When the Multitouch HID Event Driver is being used, the trackpad does not work at all. I wonder if you wouldn't mind helping ELAN trackpad users. Another case showing the same symptom can be found here: https://github.com/acai66/lenovo-miix-520-hackintosh

sorry I don't have such hardware and currently I don't even have access to the keyboard dock tablet so I can't bang my head against those :(

Hahaha ok, thank you for replying!

@jlempen
Copy link

jlempen commented May 27, 2021

FYI, I just installed VoodooI2C and the VoodooI2CHID plugin compiled with this commit on a Dell Latitude 5290 2-in-1, which uses an Alps V6 Touchpad in its type cover connected via USB, and the trackpad works beautifully with all gestures now.
This commit has made all my tablet trackpads usable with full gesture support and the touchscreens keep working as before (Microsoft Surface Go 2 with an ELAN touchpad, Lenovo ThinkPad X1 Tablet Gen 3 with a Synaptics touchpad, and now Dell Latitude 5290 2-in-1 with an Alps touchpad).

@ben9923
Copy link
Member

ben9923 commented Sep 7, 2021

@Kethen would you mind rebasing the branch against upstream?
That fork is unsynced with VoodooI2C, leading to scaling issues.

Anyway, we need more testers...

@ben9923
Copy link
Member

ben9923 commented Sep 12, 2021

Just noticed that's the only place VoodooI2CPrecisionTouchpadFeatureReport is used, so it may be removed as well.

@1Revenger1
Copy link
Contributor

With this, the VoodooI2CHIDDevice Multitouch HID Event Driver personality is never used as well. Other personalities attach to the same usage pairs and have higher probe scores. Only thing it's used for right now is USB touchpads. Can be a different PR, or be left in for people who want to more easily test I guess.

@ben9923
Copy link
Member

ben9923 commented Dec 16, 2021

@Kethen Would you mind rebasing this on top of master? It seems like there's a conflict there.
Also note the needed removal of the feature report class, it's never used with those changes.

I wanna get this merged in, and release a new version.

@1Revenger1 I think we can keep that personality there as a fallback, though currently I see no reason for the derived personalities to fail :P

@Kethen
Copy link
Contributor Author

Kethen commented Dec 17, 2021

@ben9923 I rebased it but I don't have any access to my test machines/ioregistry/xcode anymore so please test this before merging, especially with the new <key>IOMatchCategory</key>

Copy link
Collaborator

@kprinssu kprinssu left a comment

Choose a reason for hiding this comment

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

This looks good to me.

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