Article View: comp.os.msdos.programmer
Article #1610Reading multiple keypresses at the same time
From: John Adair
Date: Fri, 13 Jul 1990 05:48
Date: Fri, 13 Jul 1990 05:48
17 lines
1393 bytes
1393 bytes
How do programs read multiple keys pressed at the same time (not just
Alt and 'X')? Many multiple player games allow two players to share
the keyboard. Is there a way to get the 8042 to alternate scan codes
between the two keys (i doubt it)? Do I have to sit there and poll
the keyboard port (0x60, I think), remembering that the first key has
sent a 'make', but not a 'break', before the second key sends a 'make'?
Is there a simpler way to do this?
Along the same lines, how do I discard the keypresses before (or as soon
as) they reach the buffer, preferably without having to constantly
read in and discard characters?
John Adair : ccastje%prism@gatech.edu : ccastje%prism.gatech.edu.BITNET
uucp: ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!ccastje
Georgia Tech Box 30812, Atlanta, GA 30332 Disclaimer:
I speak only for myself, and in no way, shape or form reflect the views or
opinions of my employer (The Office of Computing Services, Georgia Tech).
Technical Details
Message-ID:
<11325@hydra.gatech.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uflorida!mephisto!prism!ccastjeShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uflorida!mephisto!prism!ccastje From: ccastje@prism.gatech.EDU (John Adair) Newsgroups: comp.os.msdos.programmer Subject: Reading multiple keypresses at the same time Message-ID: <11325@hydra.gatech.EDU> Date: 13 Jul 90 05:48:14 GMT Distribution: na Organization: Georgia Institute of Technology Lines: 17