Check for key strokes while running a separate loop

조회 수: 4 (최근 30일)
Michal Elad
Michal Elad 2021년 8월 22일
답변: Voss 2021년 8월 24일
Hi :)
I'm trying to check for keyboard strokes timing while presenting photos on the screen. I don't want the timing of the presentation to be influenced by the keystroke, just to record it in the back.
Any suggestions on how to do it?
Thank you,
Michal
  댓글 수: 1
Adam Danz
Adam Danz 2021년 8월 23일
You can assign a buttonDownFcn or a windowButtonDownFcn to the axes, figure, or object that responds to keyboard interactions. The callback function can write the keystroke data to a text file or store the data internally as a variable. See the documentation for axes/figure/[your object] to learn about these callback functions.

댓글을 달려면 로그인하십시오.

답변 (1개)

Voss
Voss 2021년 8월 24일
You can assign a WindowKeyPressFcn to the figure. You may want a WindowKeyReleaseFcn as well.

카테고리

Help CenterFile Exchange에서 Desktop에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by