home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!uwm.edu!ogicse!qiclab!leonard
- From: leonard@qiclab.scn.rain.com (Leonard Erickson)
- Newsgroups: comp.lang.pascal
- Subject: Re: A Simple TP6 question
- Message-ID: <1992Jul21.134054.23075@qiclab.scn.rain.com>
- Date: 21 Jul 92 13:40:54 GMT
- Article-I.D.: qiclab.1992Jul21.134054.23075
- References: <1992Jul20.130530.1@eagle.wesleyan.edu>
- Reply-To: 70465.203@compuserve.com
- Organization: SCN Research/Qic Laboratories of Tigard, Oregon.
- Lines: 37
-
- cspradling@eagle.wesleyan.edu writes:
-
- >This is a pretty stupid question, but I really stuck with this small piece of
- >code and the manual's directions don't work (at least for me). What I want to
- >do is have full function of my arrow keys. Since the ascii values are prefixed
- >by a null character to distinguish them from the alphanumeric values I am
- >having trouble. My turbo pascal manual instructs:
-
- >if keypressed then
- > if readkey = chr(0) then
- > if readkey = 'K' then
- > do leftarrow
-
-
- >But this doesn't work. Any help on this would be appreciated. Thanks,
-
- You have to test for *all possible* extended keys if readkey = chr(0)!
- Otherwise you've just lost the keystroke unless it's the first one you
- test for!
-
- if keypressed then
- begin
- if readkey = chr(0) then
- case readkey of
- ....
- 'K' : left_arrow;
- ....
- otherwise
- unknown_key;
- end;
- {regular key handling goes here}
- end;
- --
- Leonard Erickson leonard@qiclab.scn.rain.com
- CIS: [70465,203] 70465.203@compuserve.com
- FIDO: 1:105/56 Leonard.Erickson@f56.n105.z1.fidonet.org
- (The CIS address is checked daily. The others infrequently)
-