If you do a search on this forum for "onCustomInput" you will find quite a few posts. The basic idea is that you set UICamera's onCustomInput to your function, and inside you do your own logic that determines where your custom pointer is located, which button got pressed, etc. You will then perform a UICamera's Raycast, then call UICamera's ProcessTouch function passing whether the button was pressed and/or unpressed.
Easiest example function to use is UICamera.ProcessFakeTouches().