home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.pascal:7863 comp.sys.ibm.pc.programmer:739
- Newsgroups: comp.lang.pascal,comp.sys.ibm.pc.programmer
- Path: sparky!uunet!wupost!gumby!destroyer!Tygra.Michigan.COM!dave
- From: dave@tygra.Michigan.COM (David Conrad)
- Subject: Re: Cursor and F1-F12 keys under Turbo-Pascal
- Organization: CAT-TALK Conferencing System
- Date: Tue, 5 Jan 1993 10:57:55 GMT
- Message-ID: <1993Jan5.105756.12801dave@tygra.Michigan.COM>
- References: <1993Jan4.134821.325@sinus.stgt.sub.org>
- Lines: 35
-
- In article <1993Jan4.134821.325@sinus.stgt.sub.org> stefan@sinus.stgt.sub.org (Stefan Bechtold) writes:
- >How can I use the cursor keys and the F1,F2...F12 keys under
- >Turbo-Pascal. Is there any solution (as it's not possible
- >through ASCII-chars) ?
-
- I usually do something like the following:
-
- var
- ch, c : char;
-
- begin
- repeat
- ch := readkey;
- if ch = #0 then c := readkey;
- case ch of
- #13 : writeln ('You pressed enter.');
- #0 : case c of
- #72 : writeln ('You pressed the up arrow.');
- #80 : writeln ('You pressed the down arrow.');
- #59 : writeln ('You pressed F1.');
- end;
- end;
- until ch = #27;
- writeln ('You pressed escape.');
- end.
-
- Note that readkey will not detect F11 and F12. To find out how to do this,
- look at keyboard.pas in /pc/turbopas/drcpas10.zip at garbo.uwasa.fi.
-
- David R. Conrad
- --
- = CAT-TALK Conferencing Network, Computer Conferencing and File Archive =
- - 1-313-882-2209, 300bps-14400bps, V.32/V.32bis/TurboPEP New users use 'new' -
- = as a login id. AVAILABLE VIA PC-PURSUIT!!! (City code "MIDET") =
- E-MAIL Address: dave@Michigan.COM
-