KeyPressFcn and WindowKeyPresFcn unable to initiate a callback function, opens command window instead (2019b).
12 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Bruno Luong
on 14 Sep 2023
Moved: Bruno Luong
on 14 Sep 2023
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 Comments
Bruno Luong
on 14 Sep 2023
Moved: Bruno Luong
on 14 Sep 2023
You might take a look at this FEX and inspire from that
See Also
Categories
Find more on Interactive Control and Callbacks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!