Article View: comp.sys.atari.st
Article #36942Keyboard input
From: c60c-3ds
Date: Wed, 08 Mar 1989 08:45
Date: Wed, 08 Mar 1989 08:45
29 lines
1649 bytes
1649 bytes
Do the Bconin and Bconstat functions lie?
while (c!='q') {
if (x=Bconstat(2)) c=Bconin(2);
printf("%d %c\n",x,c);
}
When I hold down a key, it starts with Bconstat=-1, which means a
character is waiting, and then Bconin gets that character. After the key
starts auto repeating, Bconstat starts to flip back to 0 sporadically (no
character waiting). I let go of the key, and Bconstat goes to 0 (no key
waiting), which is fine.
Then when I press 'q' to quit, and I see the keyboard buffer dumped
out (into the Gulam shell). If I had put a getchar() after the loop,
the keyboard buffer would be barfed out there. In any case, some keys
were missed and just sat in the buffer.
Shouldn't Bconstat return -1 until they keyboard buffer is empty?
I'm asking this because I wrote a small game that used the keyboard.
After a while of playing, the buffer would fill up, overwrite ram, and crash
the machine (this is a known bug in the keyboard handler).
P.S. Are there better ways to get keys from the keyboard? i've tried
evnt_multi(), and it does the same thing, no matter how long a delay
I tell evnt_multi() to generate.
John Kawakami c60c-3ds@web.berkeley.edu
Technical Details
Message-ID:
<21306@agate.BERKELEY.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!web-1b.berkeley.edu!c60c-3dsShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!web-1b.berkeley.edu!c60c-3ds From: c60c-3ds@web-1b.berkeley.edu Newsgroups: comp.sys.atari.st Subject: Keyboard input Message-ID: <21306@agate.BERKELEY.EDU> Date: 8 Mar 89 08:45:43 GMT Sender: usenet@agate.BERKELEY.EDU Reply-To: c60c-3ds@web-1b.berkeley.edu () Organization: University of California, Berkeley Lines: 29