to write a code for esc key
Mostrar comentarios más antiguos
how to write a code for when we press the esc key from keyboard it close for uifigure
Respuestas (1)
Prathamesh Kulkarni
el 7 de Jul. de 2022
0 votos
I understand you want to close uifigure after pressing escape key.
For that you can set the KeyPressFcn property of the uifigure as a function eg. keycall
and then check if the pressed key is escape, if it is then you can use close() command.
a = uifigure;
set(a,'KeyPressFcn',@keycall)
function keycall(a, e)
if isequal(e.Key, 'escape')
close(a);
end
end
2 comentarios
PA
el 7 de Jul. de 2022
Prathamesh Kulkarni
el 7 de Jul. de 2022
Editada: Prathamesh Kulkarni
el 7 de Jul. de 2022
Yes you can use key release function as well.
This documentation will give you idea about the feature and implementation of both functions.
Categorías
Más información sobre Interact with Maps en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!