Skip to content

Commit

Permalink
The stylus check is a holdover from the previous native multitouch. F…
Browse files Browse the repository at this point in the history
…or whatever reason it does not work in this context and I've created a pull request that fixes the associated issues here -- VoodooI2C/VoodooI2C#295 (#13)
  • Loading branch information
blankmac committed Apr 27, 2020
1 parent 91b0c5c commit 37face3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
13 changes: 4 additions & 9 deletions VoodooInput/VoodooInputSimulator/VoodooInputSimulatorDevice.cpp
Expand Up @@ -44,10 +44,7 @@ void VoodooInputSimulatorDevice::constructReportGated(const VoodooInputEvent& mu
input_report.Unused[4] = 0;

const VoodooInputTransducer* transducer = &multitouch_event.transducers[0];

if (transducer->isValid && transducer->type == VoodooInputTransducerType::STYLUS)
stylus_check = 1;


// physical button
input_report.Button = transducer->isPhysicalButtonDown;

Expand Down Expand Up @@ -79,8 +76,8 @@ void VoodooInputSimulatorDevice::constructReportGated(const VoodooInputEvent& mu
bool input_active = input_report.Button;
bool is_error_input_active = false;

for (int i = 0; i < multitouch_event.contact_count + stylus_check; i++) {
const VoodooInputTransducer* transducer = &multitouch_event.transducers[i + stylus_check];
for (int i = 0; i < multitouch_event.contact_count; i++) {
const VoodooInputTransducer* transducer = &multitouch_event.transducers[i];

if (!transducer || !transducer->isValid)
continue;
Expand Down Expand Up @@ -312,9 +309,7 @@ bool VoodooInputSimulatorDevice::start(IOService* provider) {
for (int i = 0; i < 15; i++) {
touch_state[i] = 2;
}

stylus_check = 0;


new_get_report_buffer = nullptr;

ready_for_reports = true;
Expand Down
Expand Up @@ -125,7 +125,6 @@ class EXPORT VoodooInputSimulatorDevice : public IOHIDDevice {
AbsoluteTime start_timestamp;
OSData* new_get_report_buffer = NULL;
UInt8 touch_state[15];
int stylus_check = 0;
IOWorkLoop* work_loop;
IOCommandGate* command_gate;
MAGIC_TRACKPAD_INPUT_REPORT input_report;
Expand Down

0 comments on commit 37face3

Please sign in to comment.