12-27-2002, 04:12 AM
here. what port 60h [inp (&H60)] does is it fires off whenever a key is pressed or released. this keeps track of the keypresses, and the key releases and stores them into kbd(). scan codes are slightly different than with inkey$, so test some of the keys with this demo
Code:
DIM kbd(140) AS INTEGER
DEF SEG = &H40: POKE &H1C, PEEK(&H1A): POKE &H17, PEEK(&H17) AND NOT 32
'frames loop
DO
'keyboard input
K% = INP(&H60): kbd(K% AND 127) = -((K% AND 128) = 0)
DEF SEG = &H40: POKE &H1C, PEEK(&H1A)
IF kbd(1) THEN EXIT DO
LOCATE 1, 40: PRINT K%
LOCATE 1, 1
FOR i = 0 TO 19
PRINT kbd%(i); " ";
PRINT kbd%(i + 20); " ";
PRINT kbd%(i + 40); " ";
PRINT kbd%(i + 60); " ";
PRINT kbd%(i + 80); " ";
PRINT kbd%(i + 100); " ";
PRINT kbd%(i + 120); " "
NEXT
LOOP
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry