Skip to content

Commit 59f1c38

Browse files
committed
feat: add basic support for stylus (no buttons), related to #14
1 parent 05981b9 commit 59f1c38

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

VoodooI2CGoodix.xcodeproj/xcuserdata/lazd.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>VoodooI2CGoodix.xcscheme_^#shared#^_</key>
88
<dict>
99
<key>orderHint</key>
10-
<integer>4</integer>
10+
<integer>5</integer>
1111
</dict>
1212
</dict>
1313
</dict>

VoodooI2CGoodix/VoodooI2CGoodixEventDriver.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,18 @@ void VoodooI2CGoodixEventDriver::fingerLift() {
7878
void VoodooI2CGoodixEventDriver::handleSingletouchInteraction(Touch touch) {
7979
int logicalX = touch.x;
8080
int logicalY = touch.y;
81+
int width = touch.width;
82+
83+
if (width == 0) {
84+
#ifdef GOODIX_EVENT_DRIVER_DEBUG
85+
IOLog("%s::Stylus hovering at %d, %d \n", getName(), logicalX, logicalY);
86+
#endif
87+
88+
// Stylus hovers come with a 0 width, so don't bother with any of our routines
89+
dispatchDigitizerEvent(logicalX, logicalY, HOVER);
90+
91+
return;
92+
}
8193

8294
UInt64 nanoseconds = getNanoseconds();
8395

VoodooI2CGoodix/VoodooI2CGoodixTouchDriver.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ void VoodooI2CGoodixTouchDriver::stop(IOService* provider) {
374374
}
375375

376376
IOReturn VoodooI2CGoodixTouchDriver::setPowerState(unsigned long powerState, IOService* whatDevice) {
377+
#ifndef GOODIX_EVENT_DRIVER_DEBUG
377378
if (powerState == 0) {
378379
if (awake) {
379380
awake = false;
@@ -390,6 +391,7 @@ IOReturn VoodooI2CGoodixTouchDriver::setPowerState(unsigned long powerState, IOS
390391
IOLog("%s::Waking up\n", getName());
391392
}
392393
}
394+
#endif
393395

394396
return kIOPMAckImplied;
395397
}

0 commit comments

Comments
 (0)