Collecting a key press

8 ビュー (過去 30 日間)
Alice
Alice 2015 年 2 月 3 日
コメント済み: Alice 2015 年 2 月 3 日
I'm trying to collect key presses and I need to see which key they pressed but MATLAB keeps giving me the numerical code as opposed to the character. How do I get the character as output instead?

採用された回答

Niels
Niels 2015 年 2 月 3 日
It would be good if you provide us with a snippet of the code you are using right now.
With the current information provided, I can suggest 2 things:
  • Convert the numeric value to a character using char()
  • Use get(gcf,'currentcharacter') to get the actual string
  1 件のコメント
Alice
Alice 2015 年 2 月 3 日
I've been using
[KeyIsDown, secs, KeyCode] = KbCheck;
response(i)=KbName(KeyCode);

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTiming and presenting 2D and 3D stimuli についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by