フィルターのクリア

can't use shortkey after pushing a button in MATLAB App

1 回表示 (過去 30 日間)
Josep Llobet
Josep Llobet 2022 年 10 月 7 日
編集済み: Josep Llobet 2022 年 10 月 7 日
Hello,
I cannot use the keyboard shortkeys defined after I have pushed a button in MATLAB App.
For example, I have a "a" keyboard shortkey that when press executes the "Thick" button:
And when I am using the keyboard shortkey it works.
But after I clicked the button, or some otherone, the shortkey keyboard does not work.
The button appears like:
And if I want to turn to use the shortkeys, I need to click outside in some non-object part of the figure, and the it turns to work.
I tryied to Enable/Unable and Visualize/Hide the button, and the blue selection disappears, but the shortkey continue does not responding:
app.Thick_Button.Enable = ~app.Thick_Button.Enable;
pause(0.0001)
app.Thick_Button.Enable = ~app.Thick_Button.Enable;
app.Thick_Button.Visible = ~app.Thick_Button.Visible;
pause(0.0001)
app.Thick_Button.Visible = ~app.Thick_Button.Visible;
I am in MATLAB 2021b.
Thank you very much!

採用された回答

Josep Llobet
Josep Llobet 2022 年 10 月 7 日
I solved it!
Because some of the @Walter Roberson advice in Press button automatically click post, you just need to turn to add the figure:
figure(app.UIFigure)
I put this command at final of the button's callback and when it is pushed then you can use shortkeky after.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by