GetKeyWait
by Jos (10584)
16 Aug 2005
(Updated 30 Jan 2012)
Wait a certain time for a single keypress (v2.1, jan 2012).
|
Watch this File
|
| File Information |
| Description |
GETKEYWAIT - get a key within a time limit
CH = GETKEYWAIT(P) waits for a keypress for a maximum of P seconds. P should be a positive number. CH is a double representing the key pressed key as an ascii number, including backspace (8), space (32), enter (13), etc. If a non-ascii key (Ctrl, Alt, etc.) is pressed, CH will be NaN.
If no key is pressed within P seconds, -1 is returned, and if something went wrong during excution 0 is returned.
See also input,
getkey, stoploop, yesno (FileExchange) |
| Acknowledgements |
Getkey
inspired this file.
This file inspired
Waitinput.
|
| MATLAB release |
MATLAB 6.5 (R13)
|
| Other requirements |
works on most ML releases |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (9) |
| 27 Nov 2010 |
Jos (10584)
|
|
|
| 24 Nov 2010 |
Sanchito
|
|
|
| 29 Oct 2009 |
Jesse Hopkins
|
|
|
| 15 Sep 2009 |
Ehsan Negahbani
|
|
|
| 26 Jun 2008 |
kk kk
|
|
|
| 27 May 2008 |
Iohan Sandoval
|
|
|
| 17 May 2007 |
Joseph Hollmann
|
|
|
| 26 Feb 2006 |
Inese Steinbahs
|
|
|
| 16 Aug 2005 |
urs (us) schwarz
|
|
|
| Updates |
| 17 Aug 2005 |
Timer object was not deleted which could cause problems after (many) repetitive calls. Thanks to us. |
| 17 Aug 2005 |
Timer object was not deleted which could cause problems after (many) repetitive calls. Thanks to us. |
| 17 Aug 2005 |
The timer object existed beyond the scope of the function, which could be problematic when the function is called often, e.g., in a long loop. |
| 23 Apr 2009 |
updated checks and output |
| 30 Jan 2012 |
changed some figure properties; added check for figure existence |
|
Contact us