Renato - I don't think that you can do this without customizing your GUI. There doesn't appear to be any event handling for mouse down and mouse up on the button itself. I was able to do something like you requested (see attached) but it required adding a callbacks to the button (ButtonDownFcn) and to the figure (WindowButtonDownFcn and WindowButtonUpFcn)....and the push button had to have itsEnable property set toInactive. The code handles the highlighting of the button and calling the pushbutton callback (once the button up event fires).
The attached code measures the time difference between the down and up events so you could use that value to determine if the button is clicked or long-pressed. (Tested on R2014a.)
There are two properties which can be used in conjunction to accomplish this.
One is the button's 'ButtonDownFcn' callback function. This callback function executes when pressing a mouse button on or near a UICONTROL object -- including when pressing the right mouse button.
The other property is the figure's 'SelectionType' property. This property indicates which kind of click was registered in the figure window -- including clicks on controls within the figure.
Putting these two together, you can define a 'ButtonDownFcn' callback for a push button which checks the figure's 'SelectionType' property to detect a right-click. An example is shown below. (In that example, the ANCESTOR function is used to get the figure's handle. If this is being done in a GUIDE-created GUI, this is unnecessary as the 'handles' structure already provides access to the figure's handle.)
Best Answer