> 
> Does M have a function such as KeyPressed?
> 
> I have a loop that I want users to be able to exit out
> of by pressing ESC.  I would normally (in other
> languages) check if a key has been pressed.  If so,
> then stop, get character, and act on it.
> 
> If I do this:
>   read Input <-- will wait for input + return
>   read *Input <-- will wait for input (without return)
> 
> Is there a way to continue if no input?
> 
> Thanks
> Kevin

if you put a timeout on the read of 0 (zero) it will act like
a key pressed function.

ie: read *Input:0  will return the ASCII value of the key in
the variable Input.  If no character is waiting, it will have the 
value of -1 .

Best Regards,
David


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Hardhats-members mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to