home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!rz.uni-hildesheim.de!mleb0097
- From: mleb0097@rz.uni-hildesheim.de (Mark Lebius)
- Subject: Re: inputting non-character keys
- Message-ID: <1992Nov9.121307.9694@rz.uni-hildesheim.de>
- Sender: news@rz.uni-hildesheim.de
- Reply-To: mleb0097@rz.uni-hildesheim.de
- Organization: Universitaet Hildesheim, RZ
- References: <92309.190434JLHHC@CUNYVM.BITNET>
- Distribution: world
- Date: Mon, 9 Nov 1992 12:13:07 GMT
- Lines: 41
-
- In article 190434JLHHC@CUNYVM.BITNET, Jack Hammond <JLHHC@CUNYVM.BITNET> () writes:
- >How does Turbo Pascal (I have 5.0) read such non-character keys as the
- >function keys, insert, home, pgup etc., and alt-keys?
-
- Hello Jack!
- Use the function ReadKey (I'm not sure if it is available in TP 5.0; if
- not: e-mail me).
- If you have pressed a function key this will first return character #0.
- If you call ReadKey again, it will return a character as normal. Here
- is a little program (I don't tested it, but it should work).
- It's written for TP6.0. If you have problems ... see above:
-
- PROGRAM TestKey;
- VAR a : CHAR;
- BEGIN
- REPEAT
- a:=Readkey; (*Get charakter from keyboard.*)
- WriteLn(Ord(a)); (*Write the ordinal number of the char.*)
- UNTIL FALSE;
- END.
-
- You stop this program by pressing simultaniously Ctrl+Break.
- It returns the values of the pressed keys. The function-keys
- return 2 values: 0 and x, a value depending on the function-
- key.
- Hope this helps.
-
- Bye,
- Mark
-
- -------------------------------------------------------------------------------
- |Mark Lebius | University of Hildesheim |
- |Mergenthalerweg 25 | E-Mail: mleb0097@rz.uni-hildesheim.de |
- |W-3000 Hannover 81 | mleb1097@rz.uni-hildesheim.de |
- |Tel. ++ 49 (5 11) 8 43 68 20 | |
- |Germany | |
- -------------------------------------------------------------------------------
- "Geh nicht immer auf dem vorgezeichneten Weg, der nur dahin fuehrt, wo andere
- bereits gegangen sind"
- A. G. Bell (1847-1922)
-
-