How to call function with button in Android Hud?

Hello, I have created a function that makes my character shoot, now I am simply trying to execute this action from a button for android that I have integrated into the hud, the button works but I don’t know how to call the “FIRE” action I would like the button to simulate that the right mouse click has been pressed, but from what I have been seeing that it is impossible
If I add the function directly I need to take the variable “equipped weapon” that is inside the character therefore it doesn’t work either … how can I do this?