🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.borland
Article #451

Re: ASCII Codes...

#451
From: Bjarne Hansen
Date: Wed, 16 Sep 1998 00:00
62 lines
2167 bytes
Try this

USES
     CRT;
VAR
     Key   : CHAR;
BEGIN
    REPEAT
    UNTIL KeyPressed;
    Key := ReadKey;
    IF Key = #0 THEN
        BEGIN
        (* If key = #0 you must readkey again to catch the second keycode *)
        Key = ReadKey;
        CASE Key OF
              #72 : BEGIN
                      (*  arrow up *)
                      END;
              #80 : BEGIN
                      (*  arrow down *)
                      END;
              #81 : BEGIN
                      (*  page down *)
                      END;
               END;
        END
    ELSE
        BEGIN
        CASE Key OF
              #72 : BEGIN
                      (*  character H *)
                      END;
               #80 : BEGIN
                      (*  character P *)
                      END;
              #81 : BEGIN
                      (*  character Q *)
                      END;
             END;

        END;
END.

Bjarne H. Hansen


John Skilbeck skrev:

> I am having problems detecting whether a cursor key is pressed or certain
> capital letters within TP 7.0.
>
> For example, the UP arrow on the keyboard is ASCII code 0 72, 'H' is ASCII
> code 72.
>
> Is it possible to detect the difference between these keys in Pascal? If so,
> how??
>
> Any suggestions would be much appreciated.
>
> Thanks,
>
> John.
Technical Details
Message-ID: <360006AE.1CADC8FE@tpost11.tele.dk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6ton52$ip0$1@news3.cableinet.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 108ebd,6641efc813030989
X-Google-Attributes: gid108ebd,public
X-Google-Thread: 10cc59,6641efc813030989
X-Google-Attributes: gid10cc59,public
X-Google-Thread: 111659,6641efc813030989
X-Google-Attributes: gid111659,public
From: Bjarne Hansen <bhhansen@tpost11.tele.dk>
Subject: Re: ASCII Codes...
Date: 1998/09/16
Message-ID: <360006AE.1CADC8FE@tpost11.tele.dk>
X-Deja-AN: 391791137
Content-Transfer-Encoding: 7bit
References: <6ton52$ip0$1@news3.cableinet.co.uk>
Content-Type: text/plain; charset=us-ascii
X-Trace: news-inn.inet.tele.dk 905971627 51758 (None) 195.249.82.141 (16-09-98 18:47:07 GMT)
Mime-Version: 1.0
Newsgroups: comp.lang.pascal.borland,comp.lang.pascal,borland.public.turbopascal