User`s guide

Customizing Callbacks in GUIDE
KeyP ress Fcn in uicontrols and figures
KeyReleaseFcn in a figure
SelectionChangeFcn in a uibuttongroup
WindowKeyPressFcn in a f ig u re or a n y of its c h ild objects
WindowKeyReleaseFcn in a figu r e or any of its child obje cts
WindowScrollWheelFcn in a f igure
Event data is passed to GUIDE-generated callbacks as the second of three
standard arguments. For components that issue no event data the argument
is empty. For those that provide event data, the argument contains a
structure, which varies in composition according to the component that
generates it and the type of event.
For example, the event data for a key-press provides informatio n on the
key(s) currently being pressed. Here is a GUIDE-generated
KeyPressFcn
callback template:
% --- Executes on key pr ess with focus on checkbox1 and no ne of its control s.
function checkbox1 _KeyPressFcn(hObject, eventdata, handles)
% hObject handle to checkbox1 (see GCBO)
% eventdata structure with the following fields (see UICONTROL)
% Key: name of the key that was pressed, in lower case
% Character: character interpre tation of the key (s) that was pressed
% Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed
% handles structure with handles and user data (see GUIDATA)
The eventdata structure passed in has three fields, identifying the Character
being pressed (such as '='), the key Modifier (such as 'con trol'), and th e
Key name (spelled out, such as 'equals').
Components that provide event data use different structures with
event-specific field names to pass data. Callbacks with event data usually are
repeatedly issued as long as the event persists or som etimes at the beginning
of an event a nd thereafter only when its values change.
Learn how callbacks use event data by looking at the GUIDE uitable example
“GUI to Interactively Explore Data in a Table (GUIDE)” on page 10-31 and
8-21