Prevent touch swipe when pressing on canvas button?

Hi everyone,

I’m currently using the new Input system in Unity 2021 and i have a swipe detection script which I’m using to detect screen swipes. In the old input system i was able to use the following line of code to prevent a swipe or touch action from occurring when pressing down on my mobile controls:

EventSystem.current.IsPointerOverGameObject(-1)

But this no longer works with the new input system. I was wondering what the alternative is for the new input system to prevent a swipe from occurring when pressing down on mobile controls?

If you have a standalone input module, click it and there should then be a button below that states to replace with inputsystemuiinputmodule. That should fix it.