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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions VoodooI2CHID/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@
</array>
<key>IOMatchCategory</key>
<string>VoodooI2CHIDMultitouch</string>
<key>IOPropertyMatch</key>
<dict>
<key>Transport</key>
<string>I2C</string>
</dict>
<key>IOProbeScore</key>
<integer>300</integer>
<key>IOClass</key>
Expand Down
13 changes: 1 addition & 12 deletions VoodooI2CHID/VoodooI2CPrecisionTouchpadHIDEventDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,7 @@
OSDefineMetaClassAndStructors(VoodooI2CPrecisionTouchpadHIDEventDriver, VoodooI2CMultitouchHIDEventDriver);

void VoodooI2CPrecisionTouchpadHIDEventDriver::enterPrecisionTouchpadMode() {
// We should really do this using `input_mode_element->setValue(INPUT_MODE_TOUCHPAD)`
// but I am not able to get it to work.

VoodooI2CPrecisionTouchpadFeatureReport buffer;
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();
digitiser.input_mode->setValue(INPUT_MODE_TOUCHPAD);

ready = true;
}
Expand Down
5 changes: 0 additions & 5 deletions VoodooI2CHID/VoodooI2CPrecisionTouchpadHIDEventDriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
#define INPUT_MODE_MOUSE 0x00
#define INPUT_MODE_TOUCHPAD 0x03

typedef struct __attribute__((__packed__)) {
UInt8 value;
UInt8 reserved;
} VoodooI2CPrecisionTouchpadFeatureReport;

/* Implements an HID Event Driver for Precision Touchpad devices as specified by Microsoft's protocol in the following document: https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/precision-touchpad-devices
*
* The members of this class are responsible for instructing a Precision Touchpad device to enter Touchpad mode.
Expand Down