Type "@" in UI edit field without closing Matlab on a German keyboard

1 回表示 (過去 30 日間)
M. A.
M. A. 2017 年 5 月 8 日
回答済み: M. A. 2017 年 6 月 7 日
Problem: Whenever I want to write the "@" sign in an edit box (uicontrol('Style','edit')) in my Matlab GUI figure, Matlab closes.
The reason is probably that in order to type an "@" sign I have to press AltGr+Q, which is the same as Ctrl+Alt+Q (German keyboard layout). The shortcut to close Matlab is Ctrl+Q. This explains the problem, but then I don't know how to input an "@" sign whithout having to rely on tricks like using the Windows Character Map utility or switching to another keyboard language as this GUI is intended to be used by other people beside me. Any suggestions? Can I disable the Ctrl+Q shortcut in my GUI as a workaround?
I use Matlab R2016b on Win7 Enterprise 64bit, German keyboard layout (QWERTZ).
  2 件のコメント
Stephen23
Stephen23 2017 年 5 月 8 日
" Can I disable the Ctrl+Q shortcut in my GUI as a workaround?"
Jan
Jan 2017 年 5 月 8 日
編集済み: Jan 2017 年 5 月 8 日
I do not have such problems with a German keyboard, Win7/64, Matlab 2009a. I will test this with 2016b in the evening. While my Matlab closes at Ctrl-Q also, Ctrl-Alt-Q creates the @, in the uicontrol and in the command window.
[EDITED] Confirmed. In R2016b typing AltGr-Q in an edit-uicontrol quits Matlab. Cruel.

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

採用された回答

M. A.
M. A. 2017 年 6 月 7 日
I filed a Service Request with Mathworks. They confirmed the issue and provided a workaround which I'd like to share here:
The figure window forwards CTRL+Q to the command window which triggers the closing operation. As a workaround, you can set the preference in MATLAB to "Confirm before exiting MATLAB". Go to preference Under General > Confirmation Dialogs Select "Confirm before exiting MATLAB" Typing "@" first time in a new figure window will trigger the confirmation. Once you hit cancel and proceed to type "@" again MATLAB won't quit. Alternatively, try clicking on the File menu to trigger population of submenus. After that, Ctrl+Q no longer quits MATLAB."
Both workarounds worked in my case.

その他の回答 (1 件)

Jan
Jan 2017 年 5 月 8 日
Confirmed: R2016b Win7/64 is closed, when you hit AltGr-Q to get an @ character in an edit-uicontrol.
uicontrol('Style', 'edit')
Using a WindowKeyPressFcn in the figure does not help.
I've removed the keyboard shortcut Ctrl-Q in the preferences and then Matlab is not closed anymore, when Ctrl-Q is pressed in the command window. But AltGr-Q still quits Matlab when pressed in a uicontrol. Ugly.

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by