Check for key strokes while running a separate loop

1 次查看(过去 30 天)
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