Getting arrow key presses in code without any figures
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 15 de Mayo de 2024
0 votos
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 comentario
John Endler
el 16 de Mayo de 2024
Movida: Voss
el 16 de Mayo de 2024
Categorías
Más información sobre Desktop en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
