-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add report ID to set input mode command, revert input_mode->setValue #60
Conversation
This should still work with USB devices since the format was fixed
@1Revenger1 What do you think of doing the following: void VoodooI2CPrecisionTouchpadHIDEventDriver::enterPrecisionTouchpadMode() {
// This appears to not work on Catalina or older though (Works in Big Sur/Monterey)
if (MACOS_VERSION >= MACOS_BIG_SUR) {
input_mode_element->setValue(INPUT_MODE_TOUCHPAD);
ready = true;
return;
}
VoodooI2CPrecisionTouchpadFeatureReport buffer;
buffer.reportID = digitiser.input_mode->getReportID();
buffer.value = INPUT_MODE_TOUCHPAD;
buffer.reserved = 0x00;
IOBufferMemoryDescriptor* report = IOBufferMemoryDescriptor::inTaskWithOptions(kernel_task, 0, sizeof(VoodooI2CPrecisionTouchpadFeatureReport));
report->writeBytes(0, &buffer, sizeof(VoodooI2CPrecisionTouchpadFeatureReport));
hid_interface->setReport(report, kIOHIDReportTypeFeature, digitiser.input_mode->getReportID());
report->release();
ready = true;
}
} |
I think the change looks good, and can make it later tonight. I still want to figure out why setValue doesn't work, but I don't have a device to test with locally (and I don't want to waste other's time). |
No worries, I appreciate the effort here. Ideally, we can also use a bit of OOP and IOMatch to selectively load the proper event driver, but we handle that in a follow up PR. |
@kprinssu this closer to what you were thinking? |
Thanks @1Revenger1, this solution will work with Catalina and new macOS versions. However, USB trackpad users will need to be on macOS 11+ for VoodooI2C to work. I think this is an okay compromise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I wish it could be solved with a simple input_mode->setValue()
. No clue on that, huh?
Thanks @1Revenger1 :)! |
This should still work with USB devices since the format was fixed.
input_mode->SetValue seems to break completely with I2C on Catalina. I wasn't able to figure out why it was broken, but this was reported to work. User's input mode report had an id of 3 (same value as Touchpad mode). It would be good to see if this works with USB devices.
VoodooI2CHID+reportID.zipVoodooI2CHID+CondReportID.zip