We know how to program Matlab to do something when a button is clicked, which is this:
button= uicontrol('Style','pushbutton','String','click me',...
'Position',[260 80 60 20],...
'Callback','disp ('' The button is clicked'')');
So the piece of code or function placed after ‘callback’ will be called whenever that button is pressed and released.( so the handler will be called only upon release of the button)
However I wanna be able to activate some code whenever the button is held down and not yet released. How can I do that?
You must use a callback function for the “ButtonDownFcn” property. From here:”
ButtonDownFcn