home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / mkey.zip / MKEY.INF (.txt) < prev   
OS/2 Help File  |  2001-02-01  |  3KB  |  47 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. MKey ΓòÉΓòÉΓòÉ
  3.  
  4. Function : MKey 
  5.  
  6. Syntax : keypress=MKey(timelimit (,timewait)) 
  7.  
  8.    timelimit   The maximum time (ms) MKey() will wait for a key to be pressed, range 1-60000 (1 minute)
  9.    timewait    Optional, the time (ms) Mkey() will pause between scanning the keyboard, range 1-1000 (1 second)
  10.    keypress    1 (key pressed) or 0 (no key pressed)
  11.  
  12. Purpose : 
  13.  
  14. Get input from the keyboard, without the requirement for a key to be pressed. 
  15. If there is no keyboard input within the given time, the function will return 
  16. 0. Use timewait (optional, may not exceed the value of timelimit) to reduce CPU 
  17. usage. 
  18.  
  19. Example : 
  20.  
  21. /* Program */
  22. timelimit=5000
  23. timewait=25
  24. SAY 'You have about 5 seconds to start typing your name.'
  25. CALL CharOut '','What is your name? '
  26. IF MKey(timelimit, timewait)=1 THEN PARSE PULL name ELSE name='unknown'
  27. SAY
  28. SAY 'Your name is' name
  29.  
  30. /* Output */
  31. You have about 5 seconds to start typing your name.
  32. What is your name?
  33. Your name is unknown (possible)
  34.  
  35. General : This function is a part of M.DLL, an OS/2 REXX DLL which gives access 
  36. to many, many easy-to-use, high-level user-I/O functions. It is now based on 
  37. usage of the mouse, but it will most likely finally become a rather complete 
  38. menu system, called "M". It will be for full-screen, text-mode only, due to OS 
  39. limitations. 
  40. Hold your horses : "M" is not available yet. 
  41.  
  42. I'm always interested in your wish-list items and comments, et cetera, related 
  43. to such an application, as long as your wish (for the time being) isn't 
  44. Windows-related : m1@uni-one.nl. M.DLL will at least be free for end-users, as 
  45. far as I can tell now. 
  46.  
  47.