Skip to content

Commit

Permalink
Add confidence bit for palm rejection (#547)
Browse files Browse the repository at this point in the history
* Add confidence bit for palm rejection

* Set Confidence bit by default

* Remove logging

* Use constant for palm type
  • Loading branch information
1Revenger1 authored Nov 4, 2024
1 parent 178808c commit 3d431f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Multitouch Support/Native/VoodooI2CNativeEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ MultitouchReturn VoodooI2CNativeEngine::handleInterruptReport(VoodooI2CMultitouc
if (inputTransducer->isValid) {
valid_touch_count++;
}

if (!transducer->confidence.value()) {
inputTransducer->fingerType = kMT2FingerTypePalm;
}

inputTransducer->isTransducerActive = transducer->tip_switch.value();
inputTransducer->isPhysicalButtonDown = !transducer->has_secondary_button && transducer->physical_button.value(); // if it has secondary button, then it will be passed as buttons on the "trackpoint" device

Expand Down
3 changes: 3 additions & 0 deletions Multitouch Support/VoodooI2CDigitiserTransducer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ VoodooI2CDigitiserTransducer* VoodooI2CDigitiserTransducer::transducer(Digitiser
transducer->collection = digitizer_collection;
transducer->in_range = false;

// Set Confidence bit for satellites which do not implement contact rejection yet
transducer->confidence.update(1, 0);

exit:
return transducer;
}
1 change: 1 addition & 0 deletions Multitouch Support/VoodooI2CDigitiserTransducer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class EXPORT VoodooI2CDigitiserTransducer : public OSObject {
DigitiserTransducerAziAltiOrentation azi_alti_orientation;
DigitiserTransducerTiltOrientation tilt_orientation;

DigitiserTransducerButtonState confidence;
DigitiserTransducerButtonState tip_switch;
TimeTrackedValue tip_pressure;

Expand Down

0 comments on commit 3d431f8

Please sign in to comment.