Fixing TouchEvents on modern Windows

Michael Hoffer info at michaelhoffer.de
Sat Oct 22 16:10:45 UTC 2022


Hi all,

it's been a while since I was active on this mailing list. Sorry for the
long silence. I am still working with JavaFX and generally very happy.

However, a couple of days ago I noticed that direct touch support on
Windows is broken on a surprisingly large number of devices since JavaFX
16. I tracked the problem down to a relatively naive attempt at
distinguishing *direct* touch events (finger based touch) from *indirect*
stylus/pen based touch events (which are basically just mouse events) which
was introduced as part of fixing https://bugs.openjdk.org/browse/JDK-8249737
.

The problem is that on a large number of touch devices without a pen, touch
events are always reported as indirect. Examples are iiyama touch monitors
(capacitive, multitouch) for Windows PCs .Those devices and even most
Surface devices since the Surface Pro 3 (verified with Surface Pro 4, 7 and
Studio) fall under that category.

The unfortunate result is that only gesture based multitouch works as
expected. I created a PR on GitHub that fixes the issue by introducing a
boolean property to the Scene class. The proposed interface can be seen
here:
https://github.com/openjdk/jfx/pull/927/commits/0caf15712a7e2e4492e6c2b5bb13417a514e41a5

I tried to explain the reasons for this API proposal here:
https://github.com/openjdk/jfx/pull/927

I fully understand that such a change cannot be introduced without prior
discussion. But since it's very urgent for our company to get this fixed, I
created the PR anyway. Just as a public draft. And we are documenting
the changes that we introduced in our JFX build. In the meantime, our
company will roll out a custom JFX build with the proposed API.

What are your thoughts? Do you agree with the proposed API? Would you
prefer a different solution?

Regards,
Michael






--





         <https://twitter.com/mihosoft>




Dr. Michael Hoffer

Website:  www.mihosoft.eu

Email:      info at michaelhoffer.de



[image: social-icon-twitter] <https://twitter.com/mihosoft>

[image: social-icon-linkedin] <https://www.linkedin.com/in/mihosoft/>

[image: social-icon-github] <https://github.com/miho>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20221022/045b7bc7/attachment.htm>


More information about the openjfx-dev mailing list