linux-surface / iptsd

Userspace daemon for Intel Precise Touch & Stylus
GNU General Public License v2.0
86 stars 39 forks source link

No touch events when pen is hovering or touching #146

Closed JohnEdChristensen closed 9 months ago

JohnEdChristensen commented 9 months ago

I'm on a SLS on arch linux in wayland. On iptsd v1.3.2

Touch and pen both work individually, but when the pen is touching the screen or in proximity, no touch events are firing (checked through libinput debug-events). Touch continuous to not work until a few seconds after the proximity-out event.

 event23  TABLET_TOOL_AXIS        +0.105s       227.19*/155.03* tilt: 36.95/-28.41  pressure: 0.00
 event23  TABLET_TOOL_PROXIMITY   +0.120s       226.31/154.89   tilt: 36.95/-28.41  pressure: 0.00  pen      (0, id 0) proximity-out
-event22  TOUCH_DOWN              +1.434s   0 (0) 17.60/75.99 (52.81/152.00mm)

During the 1.434s before the TOUCH_DOWN I am quickly tapping on the screen.

I've tried setting DisableOnStylus = false in /etc/iptsd.conf but that seemed to have no effect.

StollD commented 9 months ago

This appears to be caused by the touch cone rejection being broken and marking all contacts as palms when the stylus is on the screen (and the cone is active).

To fix this now, set CheckCone = false in the iptsd config: https://github.com/linux-surface/iptsd/blob/master/etc/iptsd.conf#L20

A proper fix most likely involves a full rewrite of the cone logic.

JohnEdChristensen commented 9 months ago

Thanks for the workaround! That's good enough for my use-case.

StollD commented 9 months ago

Could you report if you get any accidental touches while using the stylus?

Would be useful for knowing whether I have to fix the rejection cone code or if I can just remove it altogether.

StollD commented 9 months ago

I have dropped the code for the touch rejection cone in 1.4.0, lets see how this goes.

JohnEdChristensen commented 8 months ago

Sad to report I am seeing more accidental touches coming from my palm with the touch rejection cone gone. I reverted back to the previous version and confirmed that it wasn't happening previously.

Thanks for your work on this, it's really close to working totally seamlessly on my device! Let me know if you need any more info.

StollD commented 8 months ago

My first recommendation would be to try calibrating iptsd, if you haven't done that already: https://github.com/linux-surface/iptsd/wiki/Calibrating-iptsd

If that doesn't help, changing DisableOnStylus to true in /etc/iptsd.conf will restore the old behaviour without the need to downgrade.

JohnEdChristensen commented 8 months ago

Calibration helped quite a bit, but there is still an occasional accidental input in some cases. DisableOnStylus set to true works pretty well for my use case (much better after the removal of the touch cone rejection, because now touch works immediately after the stylus is out of range), but what would be ideal is a "DisableOnStylusTouched" option.

Right now my only complaint is that I would like to have touch disabled when the stylus is actually touching the screen, but enabled when the stylus is hovering or totally out of range. Currently when DisableOnStylus is set to true, touch is disabled while the pen is hovering and I have to move it further back than is natural to be able to use the touch screen.

The accidental touches I'm running into are most annoying when the pen is actually in contact with the screen because drawing programs will start drawing lines zigzagging between the touch event and the stylus.

Despite this small nitpick, it's in a very usable state now!