Setting KeyPressFcn on current figure
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi all,
I have defined a KeyPressFcn (or WindowKeyPressFcn) for a figure. Now I want to keep that callback active while another figure has focus. Is this possible? Figure callbacks seem not to work on current figures but on focused figures. Can I change that, or is there some other solution?
Thanks!
Jaap
댓글 수: 0
답변 (2개)
Sean de Wolski
2012년 2월 10일
No, the figure with the callback has to have focus. You could have a new figure take over with the keypressfcn while it's active perhaps. We'd need more detail to help you with a solution.
댓글 수: 0
Jaap
2012년 2월 13일
댓글 수: 1
Sean de Wolski
2012년 2월 13일
So the callback (keypressfcn) on the scatterplot that opens the new figure should pass it information with the handle to that point, the figure/axes handles and any other information it might need. Then it sets the keypressfcn of the new figure to do what you want (I would keep this callback in a standalone *.m file). The behavior that you want is completely feasible.
I hope this helps. Post more information if you want more detail.
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!