At first glance this may seem simple, but the left, top positions of views are relative to their parents.
If all buttons have activity as parent then identifying the button is easy. If the layout has buttons inside panels, it is more difficult.
The code below will identify a button from its properties, if all buttons have activity as parent.
Once the button is identified, you have another challenge. How to know what event-handler to call?
You can put the event name in the tag property in designer.
When button is identified, you can retrieve that string and then use CallSub(Me, evName & "_Click)
The code below is for B4XPages, where Root is like Activity in standard templates.
Private Sub PressButton(X As Float, Y As Float)
For i = 0 To Root.NumberOfViews - 1
Dim thisView As B4XView = Root.GetView(i)
If thisView Is Button Then
If thisView.Left <= X And (thisView.Left + thisView.Width) >= X Then
If thisView.Top <= Y And (thisView.Top + thisView.Height) >= Y Then
CallSub(Me, thisView.Tag.As(String) & "_Click")
End If
End If
End If
Next
End Sub