Key press in GUI

Hello, is it possible to detect pressing of modifier keys (Ctrl, Alt, Shift) or Home, Pgdn etc. in GUI? I use command get(gcf,'CurrentCharacter'), but for mentioned keys I get empty variable.
Thank you

 採用された回答

Jan
Jan 2011 年 6 月 11 日

3 投票

You can catch such keys in the WindowKeypressFcn. This will help you to identify the names of the pressed keys:
FigH = figure
set(FigH, 'WindowKeyPressFcn', @KeyPress)
function KeyPress(Source, EventData)
disp(EventData)
Another idea is to use the (still undocumented?) "CurrentKey" and "CurrentModifier" properties of the FIGURE.

1 件のコメント

tomas
tomas 2011 年 6 月 11 日
Diky

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCommunications Toolbox についてさらに検索

タグ

質問済み:

2011 年 6 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by