Skip to content

Commit 9ebbc8f

Browse files
authored
Fix button bits (#70)
1 parent 858c6f2 commit 9ebbc8f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

VoodooI2CHID/VoodooI2CMultitouchHIDEventDriver.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,16 @@ void VoodooI2CMultitouchHIDEventDriver::handleDigitizerTransducerReport(VoodooI2
269269
}
270270
break;
271271
case kHIDPage_Button:
272-
setButtonState(&transducer->physical_button, (usage - 1), value, timestamp);
272+
if (usage == kHIDUsage_Button_1) {
273+
// kHIDUsage_Button_1 is for the clickpad surface
274+
setButtonState(&transducer->physical_button, 0, value, timestamp);
275+
} else {
276+
// kHIDUsage_Button_2/3 are for external buttons, thus should be reported
277+
// through the trackpoint device.
278+
transducer->has_secondary_button = true;
279+
setButtonState(&transducer->physical_button, (usage - 2), value, timestamp);
280+
}
281+
273282
handled |= element_is_current;
274283
break;
275284
case kHIDPage_Digitizer:

0 commit comments

Comments
 (0)