How to execute function after pressing Return while focused to an Edit Field App Designer Object?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Austin B
am 13 Jun. 2022
Beantwortet: Abhishek Chakram
am 20 Jun. 2022
I have a GUI with 2 edit fields which I would like to run different functions when "return" is pressed. The parent UIFigure has the ability to set up a keypress callback, but it's children Edit field objects do not, and they do not "inhert" its keypress function either, meaning if you are focused on (ie typing in) an Edit Field, the UIFigure's keypress callbacks are not available. Is there a way to add keypress functions to indvidual App Designer objecs?
0 Kommentare
Akzeptierte Antwort
Abhishek Chakram
am 20 Jun. 2022
Hi Austin,
I understand that you want to execute a function by pressing return/enter while the editfield is in focus.
To my understanding, you can add two different ValueChangedFcn callbacks to both the editfields. The callback will be executed when the user is finished typing and presses enter. Here, the callback will also be executed when the user is finished typing and click anywhere outside the editfield.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!