KeyPressFcn and WindowKeyPresFcn unable to initiate a callback function, opens command window instead (2019b).
Afficher commentaires plus anciens
Hey there,
I'm trying to map a specific key to activate a callback within my matlab gui figure. However, whenever a key is pressed, this key is forwarded to the command window instead. I have already viewed the following answer, however this fix did not work (https://au.mathworks.com/matlabcentral/answers/385499-in-matlab-r2017a-how-do-i-change-the-focus-of-the-windowkeypressfcn-figure-callback-function-from). Any ideas about how to force the gui figure to remain in focus to actually call the callback function?
Cheers.
Réponses (1)
Bruno Luong
le 14 Sep 2023
Déplacé(e) : Bruno Luong
le 14 Sep 2023
0 votes
My experience is that when you activate zoom/pan/rotate on the figure, then the WindowKeyPressFcn are changed by zoom and pan and the focus steel reveals that fact.
make sure then the interactive tools are off.
2 commentaires
Bruno Luong
le 14 Sep 2023
Déplacé(e) : Bruno Luong
le 14 Sep 2023
You might take a look at this FEX and inspire from that
Bailey
le 14 Sep 2023
Déplacé(e) : Bruno Luong
le 14 Sep 2023
Catégories
En savoir plus sur Interactive Control and Callbacks dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!