home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!mcsun!news.funet.fi!cs.joensuu.fi!jpehko
- From: jpehko@cs.joensuu.fi (Juha Pehkonen)
- Subject: Re: HOW DO YOU READ MORE THAN ONE KEY
- Message-ID: <1992Nov19.100442.2914@cs.joensuu.fi>
- Organization: University of Joensuu
- References: <1992Nov19.025936.35994@ns1.cc.lehigh.edu>
- Date: Thu, 19 Nov 1992 10:04:42 GMT
- Lines: 30
-
- mas4@ns1.cc.lehigh.edu (MICHAEL ANTHONY STRAUSS) writes:
- >I'm currently writing a program on Turbo 6.0 that requires more than one key
- >to be read at once. Does anyone out there know how to do this. Any code or
- >suggestions would be appreciated. Thanx in advance...
-
- Just forget about it :-) But seriously, if you're talking about reading
- multiple keypresses at the same time, then you should try Port-function.
- Don't try to find it with Ctrl-F1 'cause it's not there. Write a short
- program like this:
-
- begin
- repeat
- write(Port[$20]);
- until (1=2);
- end;
-
- Yep, it's quick'n dirty but it does the job. Press down keys and watch the
- output change. Everytime you press/release a key new code is 'sent' to
- port $20. You probably got 102 keys in your keyboard, so there are 204
- different codes (or so one would assume :-). All you have to do is find
- out which is which. The codes are not ASCII codes. If I'm not totally
- wrong, you get code 1 when you press Esc, code 2 when you press F1, etc.
-
- You can use boolean variables (or boolean arrays) to determine which keys
- are pressed down. The rest should be rather TRIVIAL. If not, sue me (or use
- e-mail :-)
-
- Juha Pehkonen
- jpehko@cs.joensuu.fi
-
-