OnPointerEvents Bugs

I have several issues with OnPointerEvents.

  1. I have a simple Visual Element that has the OnPointerDown event. When I mouse over it and press down on my mouse, it registers twice. If I move the mouse while holding the mouse button down, it registers a third time. This happens when using Simulated Touch Input with the new input system. Case #: 1287927

  2. Using PointerEnterEvent doesn’t work on my iPad Pro 2018 and iPhone XS. Case #: 1288234

Thanks!

Bump

Hi MousePods,

  1. Mouse events are also sent when using touch input, and are considered as Pointer events as well. So to detect touch input, what we typically check on registered pointer events is : evt.pointerType != PointerType.mouse && evt.isPrimary. That way you should only get 1 pointer down. For the third one on mouse move, this is something we need to investigate, thanks for filling the bug.

  2. We’ll have to look into it, thanks again for filling the bug!

Cheers :slight_smile:

Hey just wondering about an update on these bugs. These have been accepted but it has been awhile with no resolution.

Thanks!

Hi, both bugs were taken by a member of the team and are actively being worked on. Stay tuned!

Hi. When I use new Input System,the evt.isPrimary is allways false in Pad.

Bump
Same issue, Unity 2020.2.6f1 and UI Toolkit runtime preview version 14

This happens when breaking inside UI Toolkit InputSystemEventSystem.cs

Comparing the two touchControls with their corresponding touchIds and using ReadValue() works though :

isPrimary = touchControl.touchId.ReadValue() == ((Touchscreen)touchControl.device).primaryTouch.touchId.ReadValue();

So @YinZuoyu if you embed the runtime package you can fix this

Thanks!!!

Just watch out, if you have some scrolling elements or just anything answering to PointerMove events, you might encounter some little performance issues :smile:

I am not sure if the issue comes from my fix or if it is a broken behaviour between UITK and the new Input System.
But other people have had similar issues by default :