ch = MGetKey(hFig) waits for keyboard/mouse button event over the specified figure handle (hFig) and returns the ascii code of the keyboard key or -1 if a mouse button was pressed (ch). An empty value is returned if an error occurs.
Unlike the (nice) getkey.m script, MGetKey does not need an auxiliary window.
Marcello Ferro (2021). MGetKey (https://www.mathworks.com/matlabcentral/fileexchange/25792-mgetkey), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!