
need help with getting cursors to work!!!!!!!!!!!!!!!!!
Quote:
> Help! I am wondering how I can get the cursor keys to respond to
> inputs. I've looked over the help files and tryed a user defined keys,
> but nothing works! %-} 8-| :-#
--
Forecast : After rainfall in September, Christmas will be in December
Regards,
Egbert Zijlema
Fax: +31 50 5844308
[
WATCHDOG.BAS 1K ]
DECLARE FUNCTION WatchDog% ()
' WATCHDOG.BAS - routine to detect cursor keys
' Author: Egbert Zijlema
' (up)Date: 25 January 1997
' Tool: Power Basic 3.2
' Modified: made QBasic compatible
' Status: Public Domain
CLS
' main menu (in your program it's better to make this a SUB!)
COLOR 7, 0
LOCATE 25, 1: PRINT "You pressed: ";
DO
KeyPressed% = WatchDog%
SELECT CASE KeyPressed%
CASE 00008: cursor$ = "Back "
CASE 18176: cursor$ = "Home "
CASE 18432: cursor$ = "Up "
CASE 18688: cursor$ = "PgUp "
CASE 19200: cursor$ = "Left "
CASE 19712: cursor$ = "Right "
CASE 20224: cursor$ = "End "
CASE 20480: cursor$ = "Down "
CASE 20736: cursor$ = "PgDn "
CASE 20992: cursor$ = "Insert"
CASE 21248: cursor$ = "Del "
CASE ELSE: cursor$ = " "
END SELECT
COLOR 15
LOCATE 25, 14: PRINT cursor$;
LOOP UNTIL KeyPressed% = 27 ' Escape key to quit
CLS
END
FUNCTION WatchDog%
DO
KeyToTrace$ = INKEY$
LOOP UNTIL LEN(KeyToTrace$)
WatchDog% = CVI(KeyToTrace$ + CHR$(0))
END FUNCTION