Board index » delphi » Cursor Movement in Pascal

Cursor Movement in Pascal

Hi,

You might think I'm dumb or something, but I've been programming in Pascal
(DOS Ver 7.0) and I cant find a way to read arrows from the keyboard and use
them  to create cursor movement. Please help. And were can I find the Win
version of Pascal? Is there a 'DEMO' version of Delphi available... or maybe
you have Delphi ver 2
and you want to sell it? (It is for use at a school).

Please contact me,

Paul,

pbae...@pix.za

 

Re:Cursor Movement in Pascal


"Mrs T Baecke" <pbae...@pix.za> wrote:

Quote
>Hi,

When ReadKey returns a #00 char, you should do another ReadKey, this gives you
access to the arrowkeys and more.

Quote
>You might think I'm dumb or something, but I've been programming in Pascal
>(DOS Ver 7.0) and I cant find a way to read arrows from the keyboard and use
>them  to create cursor movement. Please help. And were can I find the Win
>version of Pascal? Is there a 'DEMO' version of Delphi available... or maybe
>you have Delphi ver 2
>and you want to sell it? (It is for use at a school).

I have a demo cd of Delphi 1, I got it for free

Quote
>Please contact me,
>Paul,
>pbae...@pix.za

Mail to S...@EuroNet.NL

Re:Cursor Movement in Pascal


all you have to do is read from port[$60] (the key board port) and make a
case statement if the numbers are 75 left, 77 right, 80 down, and i cant
remember up.
if you dont know how to use port[$60] then you can make a var key for
example and put
repeat
   if keypressed then
      key := readkey
case key of and so on like above
until key = 1(escape);

thats all you have to do its pretty easy

Olaf van der Spek <S...@EuroNet.NL> wrote in article
<6aau6e$...@news.euro.net>...

Quote
> "Mrs T Baecke" <pbae...@pix.za> wrote:

> >Hi,

> When ReadKey returns a #00 char, you should do another ReadKey, this
gives you
> access to the arrowkeys and more.

> >You might think I'm dumb or something, but I've been programming in
Pascal
> >(DOS Ver 7.0) and I cant find a way to read arrows from the keyboard and
use
> >them  to create cursor movement. Please help. And were can I find the
Win
> >version of Pascal? Is there a 'DEMO' version of Delphi available... or
maybe
> >you have Delphi ver 2
> >and you want to sell it? (It is for use at a school).

> I have a demo cd of Delphi 1, I got it for free

> >Please contact me,

> >Paul,

> >pbae...@pix.za

> Mail to S...@EuroNet.NL

Re:Cursor Movement in Pascal


Quote
Diesel wrote:
> all you have to do is read from port[$60] (the key board port) and make a
> case statement if the numbers are 75 left, 77 right, 80 down, and i cant
> remember up.
> if you dont know how to use port[$60] then you can make a var key for
> example and put
> repeat
>    if keypressed then
>       key := readkey
> case key of and so on like above
> until key = 1(escape);

port[$60] is the direct hardware line to the keyboard.  The values read from
this port have no immediate relation to those returned by readkey().  The
readkey() function uses the BIOS, which processes raw scancodes into BIOS key
codes.

--
Scott Earnest            | SPAM protection in effect. Remove  |
setech@_ix.netcom.com    | "_" as needed for true addresses.  |
earnests@_homenet.lm.com |    UIN:1136443  EFnet:pale_blue    |
sinykal@_{*word*104}space.org  | URL: http://www.netcom.com/~setech |

Re:Cursor Movement in Pascal


Quote
"Diesel" <diese...@geocities.com> wrote:

In the first place, what was wrong with my answer. It also reads the arrowkeys.

Quote
>all you have to do is read from port[$60] (the key board port) and make a
>case statement if the numbers are 75 left, 77 right, 80 down, and i cant
>remember up.
>if you dont know how to use port[$60] then you can make a var key for
>example and put
>repeat
>   if keypressed then
>      key := readkey
>case key of and so on like above
>until key = 1(escape);
>thats all you have to do its pretty easy

Well, you could miss the keys, because after some scan codes come others, for
example $E0 $2A after the arrows keys.

Quote
>Olaf van der Spek <S...@EuroNet.NL> wrote in article
><6aau6e$...@news.euro.net>...
>> "Mrs T Baecke" <pbae...@pix.za> wrote:

>> >Hi,

>> When ReadKey returns a #00 char, you should do another ReadKey, this
>gives you
>> access to the arrowkeys and more.

>> >You might think I'm dumb or something, but I've been programming in
>Pascal
>> >(DOS Ver 7.0) and I cant find a way to read arrows from the keyboard and
>use
>> >them  to create cursor movement. Please help. And were can I find the
>Win
>> >version of Pascal? Is there a 'DEMO' version of Delphi available... or
>maybe
>> >you have Delphi ver 2
>> >and you want to sell it? (It is for use at a school).

>> I have a demo cd of Delphi 1, I got it for free

>> >Please contact me,

>> >Paul,

>> >pbae...@pix.za

>> Mail to S...@EuroNet.NL

Mail to S...@EuroNet.NL

Re:Cursor Movement in Pascal


Re:Cursor Movement in Pascal


Quote
> cursor movements.....
> .....

//,
//, Hi
//,
//, Your problem about to move the cursor
//, with the arrow-keys....
//,
//, const arle = #??     {-to get the right values for this key -}
//,       arup = #??     {-take a look at the ascii-table, you  -}
//,       arri = #??     {-found it in every book. I only know  -}
//,       ardn = #??     {-that CR=13, LF=10, BS=8, TAB=9,      -}
//,       zero = #0      {-shift+TAB=0+15                       -}
//,       esc  = #27;    {-our use my program MZASC2 to get the right
code        -}
//,                    
{-http://www1.ai.fh-nuernberg.de/~unix101/MZHP/MZASC2.ARJ-}
//, procedure movecursor;
//, var c   : char;
//,     x,y : integer;
//, begin
//, x:=wherex; {-init with the current cursor position-}
//, y:=wherey;
//, repeat gotoxy(x,y); {-cursor out at position x/y-}
//,        c:=readkey;
//,        if (c = zero) then begin {-key with two codes-}
//,           c:=readkey;
//,           case c of
//,              arle: if (x >  1) then dec(x);
//,              arup: if (y >  1) then dec(y);
//,              arri: if (x < 80) then inc(x);
//,              ardn: if (y < 25) then inc(y);
//,           end; {case}
//,        end else begin {-key with one code-}
//,           case c of
//,              esc: ; {-exit procedure-}
//,                 : ;  {-here you can define other functions-}
//,           end; {case}
//,        end;
//, until (c = esc);
//, end; {-procedure movecursor-}
//,
//, The only problem is the position x=80, y=25 to avoid
//, a screen scrolling.
//,
//, Bye bye
//, M.Z.
//,

Re:Cursor Movement in Pascal


Quote
"M.Z." <Manfred.Z...@ai.fh-nuernberg.de> wrote:

I had no problems, and never use the CRT unit. I just said he could miss keys.

Quote
>> cursor movements.....
>> .....
>//,
>//, Hi
>//,
>//, Your problem about to move the cursor
>//, with the arrow-keys....
>//,
>//, const arle = #??     {-to get the right values for this key -}
>//,       arup = #??     {-take a look at the ascii-table, you  -}
>//,       arri = #??     {-found it in every book. I only know  -}
>//,       ardn = #??     {-that CR=13, LF=10, BS=8, TAB=9,      -}
>//,       zero = #0      {-shift+TAB=0+15                       -}
>//,       esc  = #27;    {-our use my program MZASC2 to get the right
>code        -}
>//,                    
>{-http://www1.ai.fh-nuernberg.de/~unix101/MZHP/MZASC2.ARJ-}
>//, procedure movecursor;
>//, var c   : char;
>//,     x,y : integer;
>//, begin
>//, x:=wherex; {-init with the current cursor position-}
>//, y:=wherey;
>//, repeat gotoxy(x,y); {-cursor out at position x/y-}
>//,        c:=readkey;
>//,        if (c = zero) then begin {-key with two codes-}
>//,           c:=readkey;
>//,           case c of
>//,              arle: if (x >  1) then dec(x);
>//,              arup: if (y >  1) then dec(y);
>//,              arri: if (x < 80) then inc(x);
>//,              ardn: if (y < 25) then inc(y);
>//,           end; {case}
>//,        end else begin {-key with one code-}
>//,           case c of
>//,              esc: ; {-exit procedure-}
>//,                 : ;  {-here you can define other functions-}
>//,           end; {case}
>//,        end;
>//, until (c = esc);
>//, end; {-procedure movecursor-}
>//,
>//, The only problem is the position x=80, y=25 to avoid
>//, a screen scrolling.
>//,
>//, Bye bye
>//, M.Z.
>//,

Mail to S...@EuroNet.NL

Other Threads