| Description |
GETKEY - get a single keypress
CH = GETKEY waits for a keypress and returns the ASCII code. Accepts all ascii characters, including backspace (8), space (32), enter (13), etc, that can be typed on the keyboard. Non-ascii keys (ctrl, alt, ..) return a NaN. CH is a double.
CH = GETKEY('non-ascii') uses non-documented matlab 6.5 features to return a string describing the key pressed. In this way keys like ctrl, alt, tab etc. can also distinguished. CH is a string.
This function is kind of a workaround for getch in C. It uses a modal, but non-visible window, which does show up in the taskbar.
Tested for ML versions 6.5 and up |