How could we differentiate touch and ui element inputs?

I took reference from the below project to rotate the entity for my FPS game. I also have a joystick to move around my character. But when I am using that joystick, the touch event also gets registered and the entity starts rotating as well. I want to use both inputs at the same time to move the character, with one not affecting the other input event. Please help me with the same.

If you detect input on the UI element, you can stop it from bubbling through the systems.

See Input | Learn PlayCanvas

This is what I did with the this mobile input library: Touchscreen Joypad Controls | Learn PlayCanvas