How to differentiate between a mouse click and a touch when on the new input system?
When you touch on a touchscreen on a UI element, the “MouseDownEvent” is triggered, even if it was a touch, not a mouse click.
In most cases this is ok since you should have not to care about which input device the user is using.
But with the new input system there is a build in touch scrolling in scroll views which was not there with the old input system. So I wrote my own, which worked with touch and mouse.
It is based on uitoolkits’ MouseDownEvent, MouseUpEvent and MouseMoveEvent.
When the new input system is active, the build-in touch one reacts and mine too. This makes it unusable on touchscreens.
And when I disable mine, touch works fine but now you can’t drag-scroll with the mouse anymore.
So how can I set up my drag-scroll script, that it only works, when the user is using the mouse?