Hi all,
I've pushbutton callback function as below:
function movefront_Callback(hObject, eventdata, handles)handles.speed.String = num2str(str2double(handles.speed.String) +1);
And I would like to call this function from the keyboard, so I've this:
function figure1_WindowKeyPressFcn(hObject, eventdata, handles)switch eventdata.Key case 'a' handles.speed.String = num2str(str2double(handles.speed.String) + 1); case 'b' handles.speed.String = num2str(str2double(handles.speed.String) - 1);end
The above code works but I called it directly from the handles structure. How do I call the callback function from the windowskeypress function?
e.g
switch eventdata.Key case 'a' @movefront_Callback(); %not working obviously
thanks in advance.
Best Answer