The IsPressed() method is what I want but it is protected and obsolete. I want to send a message while a button is pressed, not on OnClick. The ways I see are
a) to duplicate internal button code and maintain a duplicate state. I do not like this solution as it fragile and error prone as the exact specification for button states is not available and it may change.
b) writing a new button component from scratch
edit: to duplicate the button state I will need to implement at least IPointerDownHandler, IPointerUpHandler, IPointerExitHandler, IPointerEnterHandler, ISelectHandler, IDeselectHandler and keep one or more internal states in addition to the visible button state. Yes this is doable but fragile and error prone since there is documented button state, state diagram. I am looking for something simpler and more robust than this.