how KeyPressFcn function works?

hi everyone, i have an edit text, pressing backspace, only when edit text become empty i want to set a string into a static text. how can i do? something like:
function edit_T KeyPressFcn(hObject, eventdata, handles)
if "press backspace" && "edit_T is empty"
set(handles.static_text,'String',string);

Respuestas (1)

Walter Roberson
Walter Roberson el 24 de Sept. de 2015

1 voto

"If you specify this property as a function handle (or cell array containing a function handle), MATLAB passes an object containing callback data as the second argument to the callback function. This object contains the properties described in the following table."
For backspace, the 'key' property will contain 'backspace'

Categorías

Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.

Preguntada:

el 24 de Sept. de 2015

Comentada:

el 13 de Jul. de 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by