Getting arrow key presses in code without any figures
Mostra commenti meno recenti
Is there a way to get key presses, including arrow keys, in an m script which does not produce or need figures?
I have browsed through mulltple entries from the MATLAB community pages but all of the m files involve figures. I do not want or need graphical input, just a user interaction with the keyboard. I do not want to use simulink. Just a plain m file.
Please give a detailed answer, I am unfamiliar with callbacks and find them very confusing. If this does not require a callback (after all no figure is involved), so much the better.
thanks
Risposta accettata
Più risposte (1)
Walter Roberson
il 15 Mag 2024
0 voti
You can potentially use one of the routines from PsychToolbox; https://www.mathworks.com/matlabcentral/answers/143088-real-time-detect-keypress#answer_285124
The toolbox as a whole would be rather heavy for your needs, but the key detection routines are mex based and could potentially be extracted from the toolbox.
1 Commento
John Endler
il 16 Mag 2024
Spostato: Voss
il 16 Mag 2024
Categorie
Scopri di più su Desktop 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!
