home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a013 / 1.ddi / SOURCE.EXE / F_SCNKEY.PRG < prev    next >
Encoding:
Text File  |  1991-01-25  |  569 b   |  24 lines

  1. *****************************************************************
  2. FUNCTION SCANKEY
  3. *****************************************************************
  4.  
  5. * Returns numeric ASCII equivalent and SCANCODE value for a key
  6.  
  7. * Copyright(c) 1991 -- James Occhiogrosso
  8.  
  9. LOCAL keypress := 0
  10.  
  11. * Wait for a key and return its value
  12. keypress = FULLKEY()
  13.  
  14. * Adjust value to a positive number
  15. keypress = IF(keypress < 0, keypress + 65536, keypress)
  16.  
  17. IF TYPE('scancode') = 'N'
  18.    scancode = INT(keypress/256)
  19. ENDIF
  20.  
  21. * Return ASCII value
  22. RETURN INT(keypress % 256)
  23.  
  24.