|
|
| File Information |
| 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 |
| Acknowledgements |
This submission has inspired the following:
GETKEYNOW, YESNO, GetKeyWait
|
| MATLAB release |
MATLAB 6.5 (R13)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (11) |
| 21 Apr 2005 |
Chris Brown
|
|
|
| 28 Apr 2005 |
Dimitri Shvorob
|
|
|
| 24 May 2005 |
George Aumann
|
|
|
| 31 Oct 2005 |
Patrick Craston
|
|
|
| 02 Nov 2005 |
Erik Helberg
|
|
|
| 02 Jan 2006 |
fred klugger
|
|
|
| 06 Jan 2006 |
Jos van der Geest
|
|
|
| 22 Apr 2008 |
Jay Vaughan
|
|
|
| 25 Apr 2008 |
Jens Rantil
|
|
|
| 27 Apr 2008 |
Jos (the author)
|
|
|
| 28 Jul 2008 |
gregor samsa
|
|
|
| Updates |
| 03 Nov 2005 |
added some minor improvements |
| 13 Dec 2006 |
updated lay-out |
| 23 Apr 2009 |
tested for newer releases |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com