Article View: comp.sys.ibm.pc.programmer
Article #1076Re: HELP: Keyboard Interrupt 09H
From: Thomas Richard Dibble
Date: Mon, 12 Oct 1992 22:40
Date: Mon, 12 Oct 1992 22:40
38 lines
2562 bytes
2562 bytes
In article <1992Oct9.154103.18137@sol.ctr.columbia.edu> jerry@connection.prospect.com (Jerry Shekhel) writes: Hello out there. I'm creating a VGA game, and I need precise keyboard control, so the kbhit()/getch() functions are insufficient. I need to know [...] This works, but the problem is that since I'm not using the BIOS to read the keystrokes (I'm just reading the key_map[] array), the BIOS buffers them up and starts clicking the speaker when the buffer overflows. Needless to say, when I'm holding keys down, this click turns into a "drumroll" and slows down my game. I tried removing the call to old_handler(), but then everything stopped working, as if the interrupt itself was no longer being generated. Can someone help me with this problem? Thanks in advance. Try putting a few getch() statements in there. These will eat the keyboard buffer. Just to make sure you have a key in there to eat, (ie, the user did not just press <Shift> or something), call (kbhit()) beforehand. I usually use the construct: for(;kbhit();) getch(); It works well. Unfortunately, many programmers do not use it, and decide that the 'drumroll' you describe is a feature rather than a bug ... ---- tomster@wpi.wpi.edu -- /^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\ | The bleeding hearts and the artists \ / Words of Wisdom, Inc. | | make their stand. And when they've / \ Thomas R. Dibble, esquire, C.E.O.| | given you their all, some stagger & \ / aka, The Tomster, Tomahawk, etc. | | fall, after all, it's not easy, / \ send mail/ money to: | | banging your heart against some mad \ / tomster@wpi.wpi.edu | | bugger's wall. ---R. Waters, _Wall_ / \ (or don't send it at all) | \vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv/
Technical Details
Message-ID:
<TOMSTER.92Oct12184045@bigwpi.WPI.EDU>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!spool.mu.edu!hri.com!noc.near.net!bigboote.WPI.EDU!nntp!tomsterReferences:
<1992Oct9.154103.18137@sol.ctr.columbia.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!spool.mu.edu!hri.com!noc.near.net!bigboote.WPI.EDU!nntp!tomster From: tomster@bigwpi.WPI.EDU (Thomas Richard Dibble) Newsgroups: comp.sys.ibm.pc.programmer,alt.msdos.programmer Subject: Re: HELP: Keyboard Interrupt 09H Message-ID: <TOMSTER.92Oct12184045@bigwpi.WPI.EDU> Date: 12 Oct 92 22:40:45 GMT References: <1992Oct9.154103.18137@sol.ctr.columbia.edu> Organization: Worcester Polytechnic Institute, Worcester, MA 01609-2280 Lines: 38 NNTP-Posting-Host: bigwpi.wpi.edu In-reply-to: jerry@connection.prospect.com's message of 9 Oct 92 15:41:03 GMT