I'm having a slight problem with the inkey$ function. It works fine but when i hold down a key it kind of pushes it once initially then waits for a moment and THEN registers it as being held down. This is very annoying for having sprites that are controlled by keyboard input and looks really unproffessional.
How do I stop this?
keyboard pushy thingy?
keyboard pushy thingy?
Towels may be harmful if swallowed in large quantities.
see the way you put your code lines, if you do this,it will need to read ALL the {codelines} unusefully, i would suggest to do this,
possibly this would solve your problem.[/code]
Code: Select all
DO
thing$ = INKEY$
{codelines}'<---
LOOP UNTIL thing$ <> nothing$
Code: Select all
DO
thing$ = INKEY$
LOOP UNTIL thing$ <> nothing$
{codelines}'<---
Nah thats not the problem. I was thinking more like sprites eg.
this code is just an example but say you want bob the happy sprite to move down on the screen when you push spacebar and for the program to end when you push "x" when you hold down the spacebar instead of bob just moving straight down he moves down one space then waits for about half a second and then starts moving down at a uniform rate.
Code: Select all
screen 13, 16, 1, 1
dim bobx as integer
bobx = 1
do
thing$ = inkey$
if thing$ = " " then
bobx = bobx + 1
cls
end if
locate (bobx,1)
print "B" 'Bob the happy happy sprite
loop until thing$ = "x"
You cant really..Hrothgar wrote:^^ that was me
I just noticed that it happens for everything to do with the keyboard. even in this forum. if you hold down a letter it types one of them, waits half a second then continues. How do I remove that delay from my programs?
It's how keyboard input works..
You can however use a KeyState routine, that only returns wheter a key is held down or not..
Try MULTIKEY()
I have left this dump.
Key thingy
Are we talking about the typematic rate and delay here?
In DOS you use the MODE command to adjust that. In windows, there's a control panel item for that.
In DOS you use the MODE command to adjust that. In windows, there's a control panel item for that.
--- Zim ---
--- Time flies like an arrow, but fruit flies like a banana ---
--- Time flies like an arrow, but fruit flies like a banana ---
- Michael Calkins
- Veteran
- Posts: 76
- Joined: Tue Apr 05, 2005 8:40 pm
- Location: Floresville, Texas
- Contact:
Yes.Are we talking about the typematic rate and delay here?
In QBASIC (under DOS), it is possible to use INP() to read from the keyboard, I think, without effect fromt he typematic rate, etc.
http://www.network54.com/Forum/171757/m ... ey+presses..
However, it seems he is using FreeBASIC, and his problem has already been solved...
Regards,
Michael
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
I like to slay Disciples of D'Sparil...