home *** CD-ROM | disk | FTP | other *** search
- 'Sun Apr 23, 1989 2:20:04 pm
- '*****************************************************************************
- 'This routine replaces the INKEY$ function. It waits for input and returns
- 'whatever key is hit. The second function returns the scan code for a key.
- '*****************************************************************************
- TYPE RegType
- ax AS INTEGER
- bx AS INTEGER
- cx AS INTEGER
- dx AS INTEGER
- bp AS INTEGER
- si AS INTEGER
- di AS INTEGER
- flags AS INTEGER
- END TYPE
- DIM SHARED inregs AS RegType, outregs AS RegType
- DECLARE FUNCTION getkey$ ()
- DECLARE FUNCTION getscan ()
-
- DO 'hit return key twice
- DO
- LOOP UNTIL getscan = &H1C
- LOOP UNTIL getkey$ = CHR$(13)
-
- FUNCTION getkey$
- CALL interrupt(&H16, inregs, outregs)
- a = outregs.ax
- scan = FIX(a / 256)
- ascii = a - (scan * 256)
- getkey = CHR$(ascii)
- END FUNCTION
-
- FUNCTION getscan
- CALL interrupt(&H16, inregs, outregs)
- a = outregs.ax
- scan = FIX(a / 256)
- getscan = scan
- END FUNCTION
-
-