How determine if a key is pressed
Mostra commenti meno recenti
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
Risposte (1)
Walter Roberson
il 12 Mar 2020
Modificato: Walter Roberson
il 16 Nov 2020
0 voti
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.
Categorie
Scopri di più su Timing and presenting 2D and 3D stimuli in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!