フィルターのクリア

Zoom breaks UIFigureWindowKeyPress in App Designer

54 ビュー (過去 30 日間)
Zel Hurewitz
Zel Hurewitz 2024 年 7 月 17 日 23:31
移動済み: Walter Roberson 2024 年 7 月 18 日 17:38
Using zoom icon in the UIAxis or the zoom() function in the startup function in App Designer seems to be stopping me from also being able to use keyboard callback.
function startupFcn(app)
zoom(app.UIAxes,'on')
end
The callback function below no longer works as desired (printing out each key to the command window).
function UIFigureWindowKeyPress(app, event)
key = event.Key;
disp(key)
end
This seems to be a similar problem to this question. Probably the UIFigure is no longer highlighted. I attached a basic app which shows this problem. Does anyone know how to fix or get around this?

採用された回答

Ayush Modi
Ayush Modi 2024 年 7 月 18 日 6:04
移動済み: Walter Roberson 2024 年 7 月 18 日 17:38
Hi Zel,
When the zoom mode is enabled(using zoom icon or by zoom function), the control stays with the function.
The UIFigureWindowKeyPress event is not triggered with zoom mode enabled because MATLAB supports only 1 function at a time. Once, the zoom mode is disabled, you can see the callback function triggered on keyPress.
If possible, disable the zoom mode from the toolbar and try to trigger the callback again with key press.
As a workaround, you can see how to trigger two or more callbacks concurrently here -
  1 件のコメント
Zel Hurewitz
Zel Hurewitz 2024 年 7 月 18 日 17:33
移動済み: Walter Roberson 2024 年 7 月 18 日 17:38
Thanks Ayush! When zoom is disabled from the toolbar, the keys work again as you were saying.
I'll make do without one or the other in my application for now. Cheers

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by