How determine if a key is pressed
69 ビュー (過去 30 日間)
古いコメントを表示
Hi,
is there a system-portable way to determine if a given key is pressed?
I found this:
but it only works for windows....
cheers,
Daniel
0 件のコメント
回答 (1 件)
Walter Roberson
2020 年 3 月 12 日
編集済み: Walter Roberson
2020 年 11 月 16 日
Depends what you mean and what you are willing to live with.
For regular keys and you are willing to have a figure covering the display then WindowKeyPressFcn callback and test the event structure.
If you need the check to work without a figure then see:
There might also be Java approaches.
The psychtoolbox functions are more complete and robust and better suited for timing.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!