I need help on INKEY$ 
Author Message
 I need help on INKEY$

I'm working on a real-time-movement game for QuickBasic 4.5.
And I was wondering how to clear the keyboard-buffer so that the program
responds to your inputs at once, instead of working with the stored
values in the buffer.

If someone could help me I would be very grateful.

Markus



Fri, 14 May 1999 03:00:00 GMT  
 I need help on INKEY$

To clear the keyboard buffer:

while inkey$<>"":wend

I hope this helps.



Sat, 15 May 1999 03:00:00 GMT  
 I need help on INKEY$


Quote:

>I'm working on a real-time-movement game for QuickBasic 4.5.
>And I was wondering how to clear the keyboard-buffer so that the program
>responds to your inputs at once, instead of working with the stored
>values in the buffer.

>If someone could help me I would be very grateful.

>Markus

        A quick and dirty way of clearing the keyboard buffer is doing a loop like this

        Do
                ' Keep looping until no keys are pressed
        Loop until Len(Inkey$) = 0



Mon, 17 May 1999 03:00:00 GMT  
 I need help on INKEY$

Quote:


>>I'm working on a real-time-movement game for QuickBasic 4.5.
>>And I was wondering how to clear the keyboard-buffer so that the program
>>responds to your inputs at once, instead of working with the stored
>>values in the buffer.

>>If someone could help me I would be very grateful.

>>Markus
>    A quick and dirty way of clearing the keyboard buffer is doing a loop like this
>    Do
>            ' Keep looping until no keys are pressed
>    Loop until Len(Inkey$) = 0

Nothing dirty, only very slow....you might read one of the other post
which i did concerning port &h60. You could also wait until someone
post a routine without controls......either way i am not going to post
it again( just look for some reaction where it says( "and &h2" and
"and &h80") .
RIck

Rick Elbers

home: http://www.geocities.com/SiliconValley/Heights/7052
QBASIC INTREPRETER PAGE for intermediate level



Tue, 18 May 1999 03:00:00 GMT  
 I need help on INKEY$

Quote:


>>I'm working on a real-time-movement game for QuickBasic 4.5.
>>And I was wondering how to clear the keyboard-buffer so that the program
>>responds to your inputs at once, instead of working with the stored
>>values in the buffer.

>>If someone could help me I would be very grateful.

>>Markus
>    A quick and dirty way of clearing the keyboard buffer is doing a loop like this
>    Do
>            ' Keep looping until no keys are pressed
>    Loop until Len(Inkey$) = 0

problem: They keybuffer will be empty again afterwards; INKEY$ clears
the buffer as soon as it's called, so this is probably better:
while a$=""
a$=inkey$
wend
'handle a$ here...

Okay? :)

Bye! :)



Tue, 18 May 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Help with the INKEY$ function for deleting...

2. PLEASE HELP: Resetting INKEY$?

3. INKEY vs INP(&h60)

4. INKEY$ vs. INT(&H60)

5. Alternative to INKEY$ - INP(&H60)

6. Key press combination with INKEY$?

7. Alternative to INKEY$

8. Inkey$ Sux!

9. INP() address for INKEY$ (and why?)

10. INKEY$

11. INKEY$

12. INKEY$ in VB5

 

 
Powered by phpBB® Forum Software