Thanks in advance,
Don
You could include the following sequence in your keypressfcn ....
if get(handles.figure1,'currentcharacter') == 'h'
%execute these instructions
end
Note that your keypressfcn executes only when the focus is on your
figure. I donot know how to detect an 'F1 key' press.
hope that helps,
Ramesh
I tried putting 'hey' in the slot, and then in the .m file for the
figure defining:
function varargout = hey
if get(handles,'CurrentCharacter') == 'h'
disp('Hey.')
end
But when I actually attempt to execute the key press, I get an error
that 'hey' is an unrecognized function. How do I actually associate a
function call for this event?
Don
"Ramesh Chandra" <itsr...@hotmail.com> wrote in message news:<eeae...@WebX.raydaftYaTP>...
I would put the string <automatic> in there. When you save the GUI, the
"<automatic>" will be replaced by the syntax necessary to call to a
subfunction of the main GUI and the main GUI m-file will be updated to
include that subfunction. After that, add your KeyPressFcn to that
subfunction.
> I tried putting 'hey' in the slot, and then in the .m file for the
> figure defining:
>
> function varargout = hey
> if get(handles,'CurrentCharacter') == 'h'
> disp('Hey.')
> end
>
> But when I actually attempt to execute the key press, I get an error
> that 'hey' is an unrecognized function.
Function scope will get you every time.
> How do I actually associate a function call for this event?
See above.
--
Steve Lord
sl...@mathworks.com