フィルターのクリア

Ues waitforbuttonpress for key press only

25 ビュー (過去 30 日間)
Michael Andersson
Michael Andersson 2020 年 9 月 25 日
回答済み: Ameer Hamza 2020 年 9 月 25 日
I am trying to cycle through a few different figures within the same figure window for presenting purposes and with loops, the waitforbuttonpress does work. However I want to be able to use the mouse to zoom and stretch my plots which I can’t do now because a mouse click changes plot. Is it possible for the waitforbuttonpress function to only accept keyboard presses.
If there is any other methods of switching between figures (increment a counter or pause the program with a key press), that would greatly help.
Thanks

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 9 月 25 日
Instead of waitforbuttonpress, use KeyPress callback for the figure object: https://www.mathworks.com/help/matlab/ref/matlab.ui.figure-properties.html#buiwuyk-1-KeyPressFcn. This callback only gets executed when a key is pressed on the keybaord.

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by